/* Top page */

/* The search bar on casino pages: 50px tall, 12px corners, on a dark well. It opens the same search as
   the header. */
.page-search {
  width: 100%;
  height: 50px;
  padding: 0 var(--space-3) 0 var(--space-4);
  border-radius: 12px;
  background: var(--field);
  box-shadow: 0 1px 3px rgb(0 0 0 / calc(0.2 * var(--shade)));
  font-size: 16px;
  cursor: text;
}

.page-search .search__placeholder {
  flex: 1;
  text-align: start;
}

/* One card per open category, sharing the row: the casino alone fills it until sports open. */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-4);
}

.category-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.category-card__art {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.category-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  transition: transform 0.3s ease;
}

.category-card:hover .category-card__image {
  transform: scale(1.04);
}

.category-card__title {
  position: absolute;
  top: var(--space-5);
  left: var(--space-6);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}

.category-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: 52px;
  padding: 0 var(--space-5);
}

.category-card__cta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 15px;
  font-weight: 700;
}

.guest-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Sign-up first: the button and the SNS shortcuts sit on a solid panel, the art on the right. */
.banner {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface-0);
}

/* Fills the row the text sets, without making it taller. */
.banner__image {
  width: 100%;
  height: 0;
  min-height: 100%;
  object-fit: cover;
  object-position: right center;
}

.banner__body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: var(--space-9) var(--space-10);
}

.banner__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
}

.banner__or {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

.banner__social {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.banner__social .button {
  padding-inline: var(--space-2);
  font-size: 14px;
}

.category-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-4);
}

.category-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: 52px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.category-bar__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

/* Shelves slide sideways a row at a time. Each tile takes a column's width, so a row
   shows as many tiles as the layout's columns. */
.shelf {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scroll-margin-top: 80px;
}

.shelf__title {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--control-md);
  color: var(--ink);
  text-decoration: none;
}

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

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

.shelf__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--shelf-cols) - 1) * var(--space-4)) / var(--shelf-cols));
  column-gap: var(--space-4);
  overflow-x: auto;
  margin-top: -6px;
  padding-top: 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.shelf__row::-webkit-scrollbar {
  display: none;
}

.shelf__row > * {
  scroll-snap-align: start;
}

/* A provider on the providers shelf: its logo on a square tile, then its name and games. */
.provider-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--ink);
  text-decoration: none;
}

.provider-tile__logo {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg);
  color: var(--on-tile-light);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}

/* Our own logo sits on the plain tile; the other studios bring their colour. */
.provider-tile__logo:not([class*="provider__logo--"]) {
  background: var(--surface-2);
}

.provider-tile__logo img {
  width: 40%;
}

.provider-tile__name {
  font-size: 14px;
  font-weight: 700;
}

.provider-tile__count {
  color: var(--ink-muted);
  font-size: 12px;
}

/* The promotions strip at the top: 146px cards with the art on the left. */
.promo-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(450px, 85%);
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.promo-strip__card {
  display: flex;
  height: 146px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  scroll-snap-align: start;
}

.promo-strip__image {
  flex: none;
  width: 146px;
  height: 100%;
  object-fit: cover;
}

.promo-strip__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-4);
}

.promo-strip__badge {
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  background: #5ECFCB;
  color: #0B1620;
  font-size: 11px;
  font-weight: 700;
}

.promo-strip__title {
  font-size: 18px;
  line-height: 1.4;
}

.promo-strip__summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* The casino's sections as tabs on a sunken track, 4px in from its edge. */
.lobby-tabs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1);
  overflow-x: auto;
  border-radius: 13px;
  background: var(--track);
  scrollbar-width: none;
}

.lobby-tabs__tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-tab);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.lobby-tabs__tab:hover {
  background: var(--surface-2);
}

.lobby-tabs__tab[aria-current="page"] {
  background: var(--selected);
}

/* Today's race and the weekly raffle. */
.races {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.races__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.races__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.race-card {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.race-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
}

.race-card__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.race-card__text h3 {
  margin: 0;
  font-size: 16px;
}

.race-card__text p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.race-card__actions {
  margin-top: var(--space-3);
}

.race-card__foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 14px;
}

.race-card__foot .progress__track {
  flex: 1;
  height: 8px;
}

.race-ring {
  position: relative;
  flex: none;
  width: 112px;
  height: 112px;
}

.race-ring svg {
  width: 100%;
  height: 100%;
  rotate: -90deg;
}

.race-ring circle {
  fill: none;
  stroke-width: 9;
}

.race-ring__track {
  stroke: var(--surface-0);
}

.race-ring__left {
  stroke: var(--focus);
  stroke-linecap: round;
}

.race-ring__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 12px;
}

.race-ring__text strong {
  color: var(--ink);
  font-size: 16px;
}

.live-plays {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* The tabs and the row count share a bar. The count hides rows past it. */
.live-plays__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.live-plays__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.live-plays__ghost.is-on {
  color: var(--focus);
}

/* A table with no plays yet says so; the line goes as soon as a row streams in. */
.live-plays__none {
  display: none;
  color: var(--ink-muted);
  text-align: center;
}

.data-table--live:not(:has(tbody tr)) .live-plays__none {
  display: table-footer-group;
}

.live-plays__none td {
  padding: var(--space-6) var(--space-4);
}

/* A row streaming in at the top of the table. */
.data-table--live tr.is-new {
  animation: live-row-in 0.4s ease-out;
}

@keyframes live-row-in {
  from {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .data-table--live tr.is-new {
    animation: none;
  }
}

.live-plays[data-rows="10"] tbody tr:nth-child(n + 11),
.live-plays[data-rows="20"] tbody tr:nth-child(n + 21) {
  display: none;
}

.live-plays .history-player {
  color: var(--ink);
  text-decoration: none;
}

.live-race {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}

.live-race__name,
.live-race__ends {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  text-decoration: none;
}

.live-race__ends {
  color: var(--ink-muted);
}

.live-race__place {
  display: inline-grid;
  place-items: center;
  width: 20px;
  margin-right: var(--space-2);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
}

.live-race__place--1 { color: #EDBE45; }
.live-race__place--2 { color: #B7C3D0; }
.live-race__place--3 { color: #C98552; }

.data-table--race {
  min-width: 0;
}

@media (max-width: 1099px) {
  .category-card__title {
    font-size: 24px;
  }
}

@media (max-width: 767px) {
  .page-search .kbd {
    display: none;
  }

  .categories {
    gap: var(--space-3);
  }

  .category-card {
    border-radius: var(--radius-lg);
  }

  .category-card__art {
    height: 120px;
  }

  .category-card__title {
    top: var(--space-3);
    left: var(--space-3);
    font-size: 18px;
  }

  .category-card__foot {
    height: 44px;
    padding: 0 var(--space-3);
  }

  .category-card__cta {
    display: none;
  }

  .banner {
    position: relative;
    display: block;
    min-height: 0;
  }

  .banner__body {
    padding: var(--space-10) var(--space-4);
  }

  /* The art fades in behind the title and buttons, never over them. */
  .banner__body {
    z-index: 1;
  }

  .banner__image {
    position: absolute;
    inset: 0;
    opacity: 0.35;
  }

  .banner__title {
    font-size: 28px;
  }

  .shelf__row {
    grid-auto-columns: calc((100% - (var(--shelf-cols) - 1) * 10px) / var(--shelf-cols));
    column-gap: 10px;
  }

  /* A page's shelves run on to the screen's edge, so the next tile peeks in. */
  .page > .shelf .shelf__row {
    margin-right: calc(-1 * var(--space-4));
    padding-right: var(--space-4);
  }

  .shelf__arrows {
    display: none;
  }

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

  .promo-strip__card {
    height: 120px;
  }

  .promo-strip__image {
    width: 110px;
  }

  .tile__art {
    padding: 10px;
    border-radius: 12px;
  }

  .tile__label {
    padding: var(--space-6) var(--space-2) var(--space-2);
  }

  .tile__name {
    font-size: 13px;
  }

  .tile__tag {
    display: none;
  }

  .tile__meta {
    gap: 6px;
    font-size: 11px;
  }

  /* The tabs alone, the lobby's size on their sunken track, sliding sideways. */
  .live-plays .segmented {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .live-plays .segmented button {
    height: 44px;
    padding: 0 var(--space-5);
    font-size: 16px;
  }

  .live-plays__tools {
    display: none;
  }

  .data-table--live {
    min-width: 0;
  }

  /* Only the game and the payout. */
  .data-table--live .live-plays__wide {
    display: none;
  }
}

/* The page about the casino, in columns, scrolling inside its card. The columns sit inside
   the scrolling card, so the text runs down rather than off to the side. */
.lobby-about {
  max-height: 320px;
  overflow-y: auto;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.lobby-about__text {
  columns: 2 320px;
  column-gap: var(--space-8);
}

.lobby-about__title {
  margin: 0 0 var(--space-3);
  color: var(--ink);
  font-size: 18px;
  column-span: all;
}

.lobby-about h3 {
  margin: var(--space-4) 0 var(--space-2);
  color: var(--ink);
  font-size: 15px;
  break-after: avoid;
}

.lobby-about p {
  margin: 0 0 var(--space-2);
}

.lobby-about a {
  color: var(--ink);
  text-decoration: underline;
}
