/* ===============================================
   POLISH - CHOOSE PAGES (Knight Dice / Coin / Card / Slot: pick a game, Knight Race: pick a track)
   The same look as the bet slips: the two choices are rounded buttons, the switch is a rounded
   box with a green knob, NEXT is the green button, the track cards are glass cards.
   Loaded AFTER the page's own CSS. Looks only: the links, texts and scripts are not touched.
   To go back, remove this one <link> from the page.
   =============================================== */

:root {
  --pc-green: #00ff92;
  --pc-crimson: rgba(120, 0, 48, 0.5);
  --pc-line: rgba(205, 205, 205, 0.12);
  --pc-panel: linear-gradient(180deg, rgba(18, 18, 18, 0.94), rgba(6, 6, 6, 0.94));
}

/* ---------- the two choices and the switch ---------- */
.kd-opt,
.kc-opt,
.kcard-opt,
.kslot-opt {
  padding: 8px 22px;
  border: 1px solid rgba(205, 205, 205, 0.2);
  border-radius: 10px;
  background: rgba(205, 205, 205, 0.05);
  opacity: 0.55;
  text-shadow: none;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.kd-opt.is-active,
.kc-opt.is-active,
.kcard-opt.is-active,
.kslot-opt.is-active {
  opacity: 1;
  color: #ffffff;
  border-color: var(--pc-green);
  background: rgba(0, 255, 146, 0.12);
  box-shadow: 0 0 16px rgba(0, 255, 146, 0.3);
  text-shadow: none;
}

.kd-switch,
.kc-switch,
.kcard-switch,
.kslot-switch {
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  background: var(--pc-panel);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(205, 205, 205, 0.03);
}

.kd-knob,
.kc-knob,
.kcard-knob,
.kslot-knob {
  border-radius: 8px;
  background: linear-gradient(180deg, #22ffa6, #00c471);
  box-shadow: 0 0 14px rgba(0, 255, 146, 0.55);
}

/* ---------- NEXT ---------- */
.kd-next,
.kc-next,
.kcard-next,
.kslot-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 56px;
  border-radius: 10px;
  background: linear-gradient(180deg, #22ffa6, #00c471);
  color: #03140c;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-shadow: none;
  box-shadow: 0 0 0 1px rgba(0, 255, 146, 0.55), 0 8px 22px rgba(0, 255, 146, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.kd-next:hover,
.kc-next:hover,
.kcard-next:hover,
.kslot-next:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 255, 146, 0.8), 0 10px 28px rgba(0, 255, 146, 0.42);
}

/* ---------- KNIGHT RACE: the track cards ---------- */
.kr-card {
  box-sizing: border-box;
  padding: 8px 8px 10px;
  border: 1px solid var(--pc-line);
  border-top: 2px solid rgba(0, 255, 146, 0.5);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 85% 38% at 50% 0%, var(--pc-crimson), rgba(0, 0, 0, 0) 72%),
    var(--pc-panel);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), inset 0 0 22px rgba(205, 205, 205, 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.kr-card-btn {
  border-radius: 8px;
  filter: none;
}

.kr-card-active:hover {
  filter: none;
  border-color: rgba(0, 255, 146, 0.5);
  border-top-color: var(--pc-green);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 255, 146, 0.25);
}

.kr-card-inactive {
  filter: grayscale(60%);
}

.kr-timer-row {
  box-sizing: border-box;
  padding: 4px 10px;
  border: 1px solid rgba(205, 205, 205, 0.1);
  border-radius: 8px;
  background: rgba(205, 205, 205, 0.05);
  font-size: 14px;
}

.kr-timer-value {
  color: var(--pc-green);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
.kd-opt,
.kc-opt,
.kcard-opt,
.kslot-opt,
.kc-opt,
.kcard-opt,
.kslot-opt {
    padding: 6px 12px;
  }

.kd-next,
.kc-next,
.kcard-next,
.kslot-next,
.kc-next,
.kcard-next,
.kslot-next {
    padding: 10px 44px;
    font-size: 20px;
  }
}

/* ---------- phone: the two choices and the switch fit the screen, with a little space on both sides ----------
   (the row was wider than the page, so the frame of "3 Choices" and "6 Choices" was cut at the left and the right) */
@media (max-width: 768px) {
  .kd-pick,
  .kc-pick,
  .kcard-pick,
  .kslot-pick {
    width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .kd-choice,
  .kc-choice,
  .kcard-choice,
  .kslot-choice {
    width: 100%;
    gap: 8px;
  }

  .kd-opt,
  .kc-opt,
  .kcard-opt,
  .kslot-opt {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 4px;
    text-align: center;
    font-size: clamp(12px, 4.2vw, 18px);
  }

  .kd-switch,
  .kc-switch,
  .kcard-switch,
  .kslot-switch {
    flex: 0 0 auto;
    width: 64px;
    height: 34px;
  }

  .kd-knob,
  .kc-knob,
  .kcard-knob,
  .kslot-knob {
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
  }

  .kd-switch[aria-checked="false"] .kd-knob,
  .kc-switch[aria-checked="false"] .kc-knob,
  .kcard-switch[aria-checked="false"] .kcard-knob,
  .kslot-switch[aria-checked="false"] .kslot-knob {
    transform: translateX(30px);
  }
}

/* ---------- KNIGHT RACE (desktop): the race board ----------
   Left: the NEXT race (big picture, its countdown, a "Place bets" button). Right: the five races after it, as a
   list with their countdowns. The size follows the room under the title (container units), so nothing can
   run into anything else. Built by the page script (buildFeatured / buildUpcoming); the phone keeps its cards. */
@media (min-width: 769px) {
  .kr-grid-d {
    container-type: size;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(300px, 400px);
    grid-template-rows: 100%;
    justify-content: center;
    align-content: stretch;
    column-gap: clamp(24px, 3vw, 56px);
    --kr-poster-h: clamp(150px, calc(100cqh - 112px), 340px);
  }

  /* the next race */
  .kr-feat {
    box-sizing: border-box;
    align-self: center;
    width: calc(var(--kr-poster-h) * 1.391 + 24px);
    max-width: 100%;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--pc-line);
    border-top: 2px solid var(--pc-green);
    border-radius: 14px;
    background:
      radial-gradient(ellipse 85% 40% at 50% 0%, var(--pc-crimson), rgba(0, 0, 0, 0) 72%),
      var(--pc-panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 22px rgba(0, 255, 146, 0.16), inset 0 0 22px rgba(205, 205, 205, 0.03);
  }

  .kr-feat-poster {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 32 / 23;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
  }

  .kr-feat-poster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
  }

  .kr-feat-poster:hover img {
    transform: scale(1.03);
  }

  .kr-feat-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border: 1px solid rgba(0, 255, 146, 0.6);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.7);
    font: 800 11px/1.3 "JetBrains Mono", monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pc-green);
  }

  .kr-feat-info {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .kr-feat-name {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .kr-feat-name strong {
    font: 800 18px/1.2 "JetBrains Mono", monospace;
    color: #ffffff;
    white-space: nowrap;
  }

  .kr-feat-name span {
    font: 400 12px/1.2 "JetBrains Mono", monospace;
    color: rgba(205, 205, 205, 0.6);
  }

  .kr-feat-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .kr-feat-time .kr-timer-label {
    font: 400 11px/1.2 "JetBrains Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(205, 205, 205, 0.6);
  }

  .kr-feat-time .kr-timer-value {
    font: 800 26px/1.1 "JetBrains Mono", monospace;
    text-shadow: 0 0 14px rgba(0, 255, 146, 0.45);
  }

  .kr-feat-cta {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 9px;
    background: linear-gradient(180deg, #22ffa6, #00c471);
    color: #03140c;
    font: 800 14px/1 "JetBrains Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(0, 255, 146, 0.55), 0 8px 22px rgba(0, 255, 146, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  }

  .kr-feat-cta:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(0, 255, 146, 0.8), 0 10px 28px rgba(0, 255, 146, 0.42);
  }

  /* the races after it */
  .kr-up {
    box-sizing: border-box;
    align-self: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--pc-line);
    border-radius: 14px;
    background: var(--pc-panel);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), inset 0 0 22px rgba(205, 205, 205, 0.03);
  }

  .kr-up-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 0 4px 6px;
    border-bottom: 1px solid rgba(205, 205, 205, 0.1);
  }

  .kr-up-head strong {
    font: 800 14px/1.2 "JetBrains Mono", monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
  }

  .kr-up-head span {
    font: 400 11px/1.2 "JetBrains Mono", monospace;
    color: rgba(205, 205, 205, 0.5);
    text-align: right;
  }

  .kr-up-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(205, 205, 205, 0.08);
    border-radius: 9px;
    background: rgba(205, 205, 205, 0.04);
  }

  .kr-up-dir {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 255, 146, 0.35);
    border-radius: 7px;
    background: rgba(0, 255, 146, 0.07);
    font-size: 11px;
    color: var(--pc-green);
  }

  .kr-up-central .kr-up-dir {
    border-color: rgba(205, 205, 205, 0.4);
    background: rgba(205, 205, 205, 0.08);
    color: #e6e6e6;
  }

  .kr-up-name {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .kr-up-name strong {
    font: 700 14px/1.2 "JetBrains Mono", monospace;
    color: #e6e6e6;
    white-space: nowrap;
  }

  .kr-up-name span {
    font: 400 11px/1.2 "JetBrains Mono", monospace;
    color: rgba(205, 205, 205, 0.5);
  }

  .kr-up-row .kr-timer-value {
    font: 700 16px/1 "JetBrains Mono", monospace;
    color: rgba(0, 255, 146, 0.85);
    font-variant-numeric: tabular-nums;
  }
}
