﻿.bookmaker-table-wrap {
  width: 100%;
  max-width: 1000px;
  min-width: 0;
  margin: 40px auto 56px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* Higher specificity than the general editor table rules, which add cell borders. */
.bookmaker-table-wrap .bookmaker-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  font-size: 14px;
}

.bookmaker-table-wrap .bookmaker-table th,
.bookmaker-table-wrap .bookmaker-table td {
  border: 0;
  padding: 16px;
  text-align: left;
  vertical-align: middle;
}

.bookmaker-table-wrap .bookmaker-table th {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.bookmaker-table-wrap .bookmaker-table tbody tr+tr td {
  border-top: 1px solid var(--line);
}

.bookmaker-table__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bookmaker-table__brand strong {
  font-size: 15px;
  font-weight: 700;
}

.bookmaker-table__logo,
.bookmaker-table__logo-placeholder {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  padding: 5px;
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.bookmaker-table__logo-placeholder {
  background: var(--surface-2);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.bookmaker-table__bonus {
  display: inline-block;
  max-width: 250px;
  color: var(--text-soft);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bookmaker-table__rating {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.bookmaker-table__rating-star {
  color: #ffbf47;
  font-size: 18px;
}

.bookmaker-table__rating strong {
  font-size: 14px;
}

.bookmaker-table__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.bookmaker-table__code,
.bookmaker-table__code-text {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.bookmaker-table__copy {
  display: flex;
  flex-shrink: 0;
  color: var(--text-soft);
}

.bookmaker-table__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.bookmaker-table__code,
.bookmaker-table__button {
  transition:
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.bookmaker-table__code.is-copied {
  border-color: var(--success);
}

.bookmaker-table__code.is-copied .bookmaker-table__copy::after {
  content: '✓';
  color: var(--success);
}

@media (hover: hover) {
  .bookmaker-table__button:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
  }

  .bookmaker-table__code:hover {
    background: var(--surface-2);
    border-color: var(--text-muted);
  }
}

@media (max-width: 767px) {
  .bookmaker-table-wrap {
    margin-block: 36px 40px;
  }

  .bookmaker-table-wrap .bookmaker-table {
    min-width: 740px;
    font-size: 13px;
  }

  .bookmaker-table-wrap .bookmaker-table th,
  .bookmaker-table-wrap .bookmaker-table td {
    padding: 12px;
  }

  .bookmaker-table-wrap .bookmaker-table th {
    font-size: 11px;
  }

  .bookmaker-table__brand {
    gap: 9px;
  }

  .bookmaker-table__brand strong {
    font-size: 14px;
  }

  .bookmaker-table__logo,
  .bookmaker-table__logo-placeholder {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 10px;
  }

  .bookmaker-table__rating strong {
    font-size: 13px;
  }

  .bookmaker-table__rating-star {
    font-size: 16px;
  }

  .bookmaker-table__code {
    min-height: 40px;
    padding: 7px 10px;
    gap: 8px;
    font-size: 13px;
  }

  .bookmaker-table__button {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bookmaker-table__button:hover {
    transform: none;
  }
}

.bookmaker-table tbody td {
  transition:
    background-color var(--transition),
    box-shadow var(--transition);
}

.bookmaker-table__logo {
  transition: transform var(--transition);
}

.bookmaker-table__copy {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  overflow: hidden;
}

.bookmaker-table__copy::after {
  content: '\2713';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: scale(0.65);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.bookmaker-table__copy svg {
  width: 13px;
  height: 13px;
}

.bookmaker-table__code.is-copied .bookmaker-table__copy svg {
  visibility: hidden;
}

.bookmaker-table__code.is-copied .bookmaker-table__copy::after {
  opacity: 1;
  transform: scale(1);
}

.bookmaker-table__code.is-copied {
  border-color: rgba(49, 201, 138, 0.32);
  background: rgba(49, 201, 138, 0.035);
}

@media (hover: hover) and (pointer: fine) {
  .bookmaker-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
  }

  .bookmaker-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 rgba(255, 59, 48, 0.55);
  }

  .bookmaker-table tbody tr:hover .bookmaker-table__logo {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bookmaker-table tbody tr:hover .bookmaker-table__logo {
    transform: none;
  }

  .bookmaker-table__copy::after {
    transition: none;
    transform: none;
  }
}

.bookmaker-table__button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(160deg, var(--accent-2), var(--accent) 65%);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.12);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.bookmaker-table__button>span {
  position: relative;
  z-index: 1;
}

.bookmaker-table__button>span::after {
  content: '\2192';
  display: inline-block;
  margin-left: 8px;
  transition: transform var(--transition);
}

.bookmaker-table__button::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: -50%;
  left: -50%;
  width: 28%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .bookmaker-table__button:hover {
    background: linear-gradient(160deg, var(--accent-2), var(--accent) 65%);
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(255, 59, 48, 0.2);
  }

  .bookmaker-table__button:hover>span::after {
    transform: translateX(3px);
  }

  .bookmaker-table__button:hover::before {
    left: 125%;
    transition: left 0.45s ease;
  }
}

@media (prefers-reduced-motion: reduce) {

  .bookmaker-table__button:hover,
  .bookmaker-table__button:hover>span::after {
    transform: none;
  }

  .bookmaker-table__button::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .bookmaker-table__code {
    padding: 7px 9px;
    gap: 6px;
    font-size: 12px;
  }
}