/* History: transactions, play history, play details and notifications. */
.history-filter {
  align-self: flex-start;
}

.data-table--history {
  min-width: 600px;
}

.data-table .data-table__ink,
.data-table .history-player,
.data-table .history-id {
  color: var(--ink);
}

.data-table .history-player,
.data-table .history-id {
  font-weight: 600;
  text-decoration: none;
}

.data-table .history-player:hover,
.data-table .history-id:hover,
.history-game:hover .history-game__name {
  color: var(--focus);
}

.history-none {
  color: var(--ink-muted);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.status-pill--win {
  background: rgb(61 220 151 / 0.14);
  color: var(--win);
}

.status-pill--warn {
  background: rgb(245 165 36 / 0.16);
  color: #F5C451;
}

.status-pill--muted {
  background: var(--surface-2);
  color: var(--ink-muted);
}

.history-game {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.history-game__art {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.history-game__art--blue { background: var(--tile-blue); }
.history-game__art--violet { background: var(--tile-violet); }
.history-game__art--coral { background: var(--tile-coral); }
.history-game__art--teal { background: var(--tile-teal); }
.history-game__art--amber { background: var(--tile-amber); }
.history-game__art--mint { background: var(--tile-mint); }

.history-game__pick {
  color: var(--ink-muted);
  font-weight: 400;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-10) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-0);
  color: var(--ink-muted);
  text-align: center;
}

.history-empty p {
  margin: 0;
}

.history-empty strong {
  color: var(--ink);
}

.history-empty__action {
  color: var(--ink);
  font-weight: 600;
}

/* The title on the left, the close button on the right, on the history and settings pages. */
.reward-page-head.closable-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.pager__range {
  color: var(--ink-muted);
  font-size: 13px;
}

.pager__links {
  display: flex;
  gap: var(--space-2);
}

.pager .button {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: 14px;
}

.pager .is-disabled {
  background: var(--surface-2);
  color: var(--ink-muted);
  cursor: default;
  filter: none;
}

/* Play details */
.play-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.play-detail p {
  margin: 0;
}

.play-detail__game {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.play-detail__meta {
  color: var(--ink-muted);
  font-size: 14px;
}

.play-detail__player,
.play-detail__fairness {
  color: var(--focus);
  font-weight: 700;
  text-decoration: none;
}

.play-detail__id {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 14px;
}

.play-detail__id > span:first-child {
  color: var(--ink-muted);
}

.play-detail__id strong {
  font-variant-numeric: tabular-nums;
}

.play-detail__copy {
  width: 32px;
  height: 32px;
  color: var(--ink-muted);
}

.play-detail__copy.is-done {
  color: var(--win);
}

.play-detail__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

.play-detail__brand::before,
.play-detail__brand::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.play-detail__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: var(--space-4) 0;
  border-radius: var(--radius-md);
  background: var(--surface-0);
  text-align: center;
}

.play-detail__stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.play-detail__stats div + div {
  border-left: 1px solid var(--surface-3);
}

.play-detail__stats dt {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
}

.play-detail__stats dd {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.play-detail__stats .is-win {
  color: var(--win);
}

.play-detail__stats .is-loss {
  color: var(--ink-muted);
}

.play-detail__fairness {
  align-self: center;
  font-size: 14px;
}

/* Notifications */
.notifications {
  position: relative;
}

.notifications__bell {
  position: relative;
}

.notifications__bell[aria-expanded="true"] {
  background: var(--surface-3);
}

.notifications__dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 2px solid var(--surface-1);
  border-radius: 50%;
  background: var(--danger);
}

.notification-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 40;
  width: 360px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: 0 16px 40px rgb(0 0 0 / calc(0.45 * var(--shade)));
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 14px var(--space-4);
}

.notification-panel__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: 16px;
}

.notification-panel__read {
  height: 32px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--focus);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.notification-panel__read:hover {
  background: var(--surface-3);
}

.notification-panel__close {
  display: none;
}

.notification-panel .history-empty {
  border-radius: 0;
  background: transparent;
}

.notification-list {
  max-height: min(420px, 60dvh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.notification {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.notification.is-unread {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.notification:hover {
  background: var(--surface-3);
}

.notification__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--ink-muted);
}

.notification__icon--accent { color: var(--focus); }
.notification__icon--win { color: var(--win); }
.notification__icon--amber { color: var(--tile-amber); }

.notification__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notification__text > span {
  color: var(--ink-muted);
  font-size: 13px;
}

.notification__text .notification__time {
  font-size: 12px;
}

.notification__dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* The list covers the page from under the header down, the bar floating over its
   foot, with a 60px head and its own close. */
@media (max-width: 767px) {
  .notification-panel:not([hidden]) {
    position: fixed;
    top: var(--phone-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    display: flex;
    flex-direction: column;
    width: auto;
    padding: 0 var(--space-4) calc(var(--bottom-nav-height) + var(--space-2) + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    background: var(--surface-0);
    box-shadow: none;
  }

  .notification-panel__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
  }

  .notification-panel__head {
    min-height: 60px;
    padding: 0;
  }

  .notification-panel__title {
    font-size: 18px;
  }

  .notification-panel__head form {
    margin-left: auto;
  }

  .notification-panel__close {
    display: grid;
  }

  .notification-list {
    flex: 1;
    max-height: none;
  }

  .notification {
    padding-inline: var(--space-3);
  }

  .notification-panel .history-empty {
    flex: 1;
    justify-content: center;
  }
}

/* Bet and transaction history: the filter and the table on a card, the table's head on a
   sunken band and its rows straight on the card. */
.history-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.history-card .table-well {
  border-radius: var(--radius-md);
  background: transparent;
}

.history-card .data-table thead th {
  height: 56px;
  background: var(--track);
}

.history-card .data-table tbody tr:nth-child(odd) {
  background: transparent;
}

.history-card .data-table tbody tr + tr {
  border-top: 1px solid var(--line);
}

.history-card .history-empty {
  background: transparent;
}
