/* Shared token-card surface for Recent Winners, Statistics and Current Targets. */
:root {
  --arbital-token-card-surface: linear-gradient(115deg, rgb(64 86 93 / 66%), rgb(15 65 97 / 72%) 58%, rgb(22 43 53 / 50%));
  --arbital-token-card-line: rgba(56, 177, 218, .34);
  --arbital-token-card-divider: rgba(113, 190, 219, .22);
  --arbital-token-card-shadow: inset 0 1px 8px rgba(116, 215, 240, .08), inset 0 -1px 10px rgba(20, 92, 132, .08), 0 8px 22px rgba(0, 0, 0, .22), 0 0 16px rgba(0, 174, 220, .06);
}

.token-card-inline-badges { display: none; }

/* Keep the requested Recent Winners surface exact at every width. */
#home-recent-winners .winner-dashboard-row.winner-mobile-card,
#home-recent-winners .winner-dashboard-row-live {
  background: linear-gradient(115deg, rgb(64 86 93 / 66%), rgb(15 65 97 / 72%) 58%, rgb(22 43 53 / 50%)) !important;
  border-color: var(--arbital-token-card-line) !important;
  box-shadow: var(--arbital-token-card-shadow) !important;
}

#home-recent-winners .winner-dashboard-row-live:hover {
  border-color: rgba(68, 202, 231, .58) !important;
  box-shadow: inset 0 1px 9px rgba(131, 228, 248, .11), 0 10px 25px rgba(0, 0, 0, .25), 0 0 18px rgba(0, 189, 226, .08) !important;
}

#home-recent-winners .winner-name,
#home-recent-winners .winner-metric strong,
#home-recent-winners .winner-time {
  text-shadow: 0 2px 10px rgba(0, 0, 0, .36) !important;
}

/* Desktop keeps the existing horizontal row, with the same glass surface. */
@media (min-width: 1100px) {
  #home-recent-winners .winner-dashboard-row-live {
    border: 1px solid var(--arbital-token-card-line) !important;
    border-radius: 15px !important;
    overflow: hidden !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table,
  html body.targets-page.targets-page .table-wrap.table-wrap table {
    border-collapse: separate !important;
    border-spacing: 0 9px !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) {
    background: var(--arbital-token-card-surface) !important;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .16));
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(n) {
    background: transparent !important;
    border-top: 1px solid var(--arbital-token-card-line) !important;
    border-bottom: 1px solid var(--arbital-token-card-line) !important;
    box-shadow: inset 1px 0 0 var(--arbital-token-card-divider) !important;
    text-shadow: 0 2px 9px rgba(0, 0, 0, .32) !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:first-child,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:first-child {
    border-left: 1px solid var(--arbital-token-card-line) !important;
    border-radius: 14px 0 0 14px !important;
    box-shadow: none !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:last-child,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:last-child {
    border-right: 1px solid var(--arbital-token-card-line) !important;
    border-radius: 0 14px 14px 0 !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n):hover > td:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n):hover > td:nth-child(n) {
    background: rgba(82, 164, 187, .08) !important;
    border-color: rgba(68, 202, 231, .56) !important;
  }
}

/* Phone and tablet use self-contained cards with three readable sections. */
@media (max-width: 1099px) {
  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows {
    gap: 10px !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) {
    --token-divider-one: 48.5%;
    --token-divider-two: 72%;
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    border: 1px solid var(--arbital-token-card-line) !important;
    border-radius: 14px !important;
    background: var(--arbital-token-card-surface) !important;
    background-image: var(--arbital-token-card-surface) !important;
    box-shadow: var(--arbital-token-card-shadow) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    backdrop-filter: blur(14px) !important;
    grid-template-columns: minmax(0, 44fr) minmax(0, 29fr) minmax(0, 27fr) !important;
    grid-template-rows: minmax(80px, auto) minmax(52px, auto) !important;
    gap: 0 !important;
    min-height: 142px !important;
    padding: 8px 12px !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) {
    grid-template-areas: "token ath gain" "call current time" !important;
  }

  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) {
    grid-template-areas: "token ath volume" "call current time" !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n)::before,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n)::before,
  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n)::after,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n)::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    z-index: 0 !important;
    top: 12px !important;
    bottom: 12px !important;
    width: 1px !important;
    height: auto !important;
    margin: 0 !important;
    border: 0 !important;
    background: var(--arbital-token-card-divider) !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n)::before,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n)::before {
    left: var(--token-divider-one) !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n)::after,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n)::after {
    left: var(--token-divider-two) !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(n) {
    z-index: 1 !important;
    text-shadow: 0 2px 9px rgba(0, 0, 0, .38) !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(1),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(1) {
    grid-area: token !important;
    align-self: stretch !important;
    justify-content: center !important;
    padding: 4px 8px 4px 0 !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(2),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(2) {
    grid-area: call !important;
    justify-content: flex-end !important;
    padding: 4px 8px 2px 0 !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(3),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(3) {
    grid-area: ath !important;
    margin: 0 10px !important;
    padding: 4px 0 7px !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(4) {
    grid-area: gain !important;
    align-self: start !important;
    margin: 9px 0 0 10px !important;
    min-height: 42px !important;
  }

  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(4),
  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(5) {
    grid-area: current !important;
    margin: 0 10px !important;
    padding: 7px 0 2px !important;
    border-top: 1px solid rgba(68, 147, 183, .29) !important;
  }

  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(5) {
    grid-area: volume !important;
    align-self: start !important;
    margin: 9px 0 0 10px !important;
    min-height: 42px !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(6),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(6) {
    grid-area: time !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin: 0 0 0 10px !important;
    padding: 4px 2px 2px !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(7),
  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(8),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(7),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(8) {
    display: none !important;
  }

  html body.statistic-page #rows .token-card-inline-badges,
  html body.targets-page #targetRows .token-card-inline-badges {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    margin: 5px 0 0 42px !important;
  }

  .token-card-chain {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #f0b90b;
    border-radius: 50%;
    background: rgba(231, 180, 46, .06);
  }

  .token-card-chain svg { width: 13px; height: 13px; }

  .token-card-migrated,
  .token-card-state {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    padding: 2px 4px;
    border-radius: 5px;
    font-size: 6px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
  }

  .token-card-migrated {
    color: #68eed3;
    border: 1px solid rgba(0, 194, 159, .13);
    background: rgba(0, 158, 122, .16);
  }

  .token-card-state.active { color: #72e9c8; background: rgba(18, 135, 103, .2); }
  .token-card-state.closed { color: #f29ab0; background: rgba(151, 50, 83, .2); }

  html body.statistic-page #rows .dashboard-token-copy strong,
  html body.targets-page #targetRows .dashboard-token-copy strong,
  html body.statistic-page #rows .metric-combo > span:first-child,
  html body.targets-page #targetRows .target-metric-value > span:first-child,
  html body.targets-page #targetRows .target-metric-value {
    text-shadow: 0 2px 10px rgba(0, 0, 0, .42) !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n) > td:nth-child(4) {
    border: 1px solid rgba(0, 224, 182, .48) !important;
    border-radius: 9px !important;
    background: linear-gradient(125deg, rgba(0, 119, 91, .45), rgba(0, 80, 72, .38)) !important;
    box-shadow: inset 0 1px 9px rgba(6, 235, 181, .19), 0 0 13px rgba(0, 218, 164, .08) !important;
    color: #42f2c6 !important;
  }

  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) > td:nth-child(5) {
    border: 1px solid rgba(42, 182, 219, .32) !important;
    border-radius: 9px !important;
    background: rgba(14, 77, 101, .25) !important;
    box-shadow: inset 0 1px 8px rgba(91, 207, 236, .1) !important;
  }
}

@media (max-width: 560px) {
  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody#rows > tr:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody#targetRows > tr:nth-child(n) {
    --token-divider-one: 44%;
    --token-divider-two: 69%;
    border-radius: 13px !important;
    grid-template-rows: minmax(76px, auto) minmax(48px, auto) !important;
    min-height: 136px !important;
    padding: 7px 10px !important;
  }

  html body.statistic-page #rows .token-card-inline-badges,
  html body.targets-page #targetRows .token-card-inline-badges { margin-left: 38px !important; gap: 3px !important; }

  .token-card-state { display: none !important; }
}
