/* ===============================================
   POLISH - PICK / ROLL / FLIP / SPIN PAGES
   The pages that come after the bet slips: Coin Prediction, the Roll, Flip and Spin pages, and the
   Trust Box with the seed buttons and START. One look with the bet slips: glass boxes with a green top
   line and a crimson light, rounded corners, green buttons.
   Loaded AFTER the page's own CSS. Looks only: sizes, scripts and class names are not touched.
   To go back, remove this one <link> from the page.
   =============================================== */

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

/* ---------- TRUST BOX: seed buttons and START ---------- */
.tb-trust-box,
.tb-trust-box-p {
  border: 1px solid var(--pr-line);
  border-top: 2px solid rgba(0, 255, 146, 0.5);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, var(--pr-crimson), rgba(0, 0, 0, 0) 75%),
    var(--pr-panel);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 0 18px rgba(205, 205, 205, 0.03);
}

.tb-seed-cell {
  border: 1px solid rgba(205, 205, 205, 0.2);
  border-radius: 8px;
  background: rgba(205, 205, 205, 0.06);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tb-seed-cell:hover {
  filter: none;
  border-color: var(--pr-green);
  background: rgba(0, 255, 146, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 146, 0.3);
}

.tb-seed-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e6e6e6;
}

.tb-start-btn {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #22ffa6, #00c471);
  color: #03140c;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-shadow: none;
  box-shadow: 0 0 0 1px rgba(0, 255, 146, 0.55), 0 6px 18px rgba(0, 255, 146, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.tb-start-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 255, 146, 0.8), 0 8px 24px rgba(0, 255, 146, 0.4);
}

.tb-start-btn:disabled,
.tb-start-btn:disabled:hover {
  background: #2b2b2b;
  color: rgba(205, 205, 205, 0.45);
  box-shadow: 0 0 0 1px rgba(205, 205, 205, 0.12);
  filter: none;
  transform: none;
}

.tb-toast {
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(6, 6, 6, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 255, 146, 0.3);
}

.tb-cseed-overlay {
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.tb-cseed-box {
  border: 1px solid rgba(205, 205, 205, 0.16);
  border-top: 2px solid var(--pr-green);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, var(--pr-crimson), rgba(0, 0, 0, 0) 75%),
    #090909;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 255, 146, 0.18);
}

.tb-cseed-input {
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
}

.tb-cseed-confirm,
.tb-cseed-cancel {
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tb-cseed-confirm {
  border: 0;
  background: linear-gradient(180deg, #22ffa6, #00c471);
  color: #03140c;
  box-shadow: 0 0 0 1px rgba(0, 255, 146, 0.55), 0 6px 18px rgba(0, 255, 146, 0.25);
}

.tb-cseed-cancel {
  border: 1px solid rgba(205, 205, 205, 0.3);
  background: transparent;
  color: #cdcdcd;
}

/* ---------- THE PLACED BETS (one line for each slip) ---------- */
.dr-placed-row,
.cf-placed-row.kd-bt-target,
[class*="placed-box"] {
  border: 1px solid var(--pr-line);
  border-left: 3px solid rgba(0, 255, 146, 0.6);
  border-radius: 8px;
  background: var(--pr-panel);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

[class*="placed-title"],
[class*="field-label"] {
  color: rgba(205, 205, 205, 0.75);
  letter-spacing: 0.03em;
}

[class*="placed-win"] {
  color: var(--pr-green);
}

/* your prediction (the line of coins) */
[class*="-field-value"] {
  border: 1px solid var(--pr-line);
  border-left: 3px solid rgba(0, 255, 146, 0.6);
  border-radius: 8px;
  background: var(--pr-panel);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* ---------- THE BIG PICTURE BOXES (dice, coins, prediction coins) ---------- */
.dr-dice-box,
[class*="-coin-card"] {
  border: 1px solid var(--pr-line);
  border-top: 2px solid rgba(0, 255, 146, 0.5);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 85% 38% at 50% 0%, var(--pr-crimson), rgba(0, 0, 0, 0) 72%),
    var(--pr-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;
}

button[class*="-coin-card"]:not(:disabled):hover {
  filter: none;
  border-color: rgba(0, 255, 146, 0.5);
  border-top-color: var(--pr-green);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 255, 146, 0.25);
}

[class*="-coin-num"] {
  color: #e6e6e6;
}

/* While the dice or the coin moves, the frame lets go: the box border and its glow fade away, and the
   edges of the clip itself fade into the box, so the motion floats instead of sitting in a picture frame. */
.dr-dice-box.dr-dice-active,
[class*="-coin-card"][class*="-coin-flipping"] {
  border-color: transparent;
  box-shadow: none;
}

.dr-dice {
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(closest-side, #000 72%, rgba(0, 0, 0, 0) 100%);
}

[class*="-coin-video"] {
  -webkit-mask-image: radial-gradient(closest-side, #000 82%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(closest-side, #000 82%, rgba(0, 0, 0, 0) 100%);
}

/* ---------- COIN SIZE (desktop): bigger coin cards; the 3-coin pages sit closer together ---------- */
@media (min-width: 769px) {
  :root {
    --kd-coin-w: clamp(160px, min(14vw, calc((100svh - 470px) / 1.375)), 210px);
  }

  .cp-coin-card,
  .c3f-coin-card,
  .c6-coin-card,
  .cf-coin-card {
    width: var(--kd-coin-w);
    height: calc(var(--kd-coin-w) * 1.375);
    padding: calc(var(--kd-coin-w) * 0.125) 0;
  }

  .cp-coin-icon,
  .c3f-coin-icon,
  .c6-coin-icon,
  .cf-coin-icon {
    width: calc(var(--kd-coin-w) * 0.75);
    height: calc(var(--kd-coin-w) * 0.75);
  }

  .cp-coin-num,
  .c3f-coin-num,
  .c6-coin-num,
  .cf-coin-num {
    font-size: calc(var(--kd-coin-w) * 0.31);
  }

  .cp-coins-row,
  .c3f-coins-row {
    justify-content: center;
    gap: clamp(20px, 2.4vw, 40px);
  }

  /* The two Flip pages: the row of coins takes what is left under the guide and the bet boxes, and the coins
     are sized from THAT space (container units), so they can never run over the boxes above or the seed bar
     below. (The prediction pages keep the fixed size above: they have fewer lines.) */
  .cf-coins-row,
  .c3f-coins-row {
    flex: 1 1 0;
    min-height: 0;
    margin: 16px 0 10px;
    container-type: size;
    align-items: center;
    --kd-coin-w: clamp(84px, min(calc(100cqh / 1.375), calc((100cqw - 40px) / 6.4)), 210px);
  }

  /* On these two pages the two small guide chips (In order / C-Seed) sit on the first line, next to the 3 steps,
     so the coins keep the height. */
  body.kd-hints-on main.cf-body .kd-hints-points,
  body.kd-hints-on main.c3f-body .kd-hints-points {
    flex: 0 1 auto;
  }
}

/* ---------- COIN PREDICTION (Coin-3 and Coin-6) ---------- */
.cp-prediction,
.c6-prediction {
  border: 1px solid var(--pr-line);
  border-left: 3px solid var(--pr-green);
  border-radius: 8px;
  background: var(--pr-panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  color: var(--pr-green);
  letter-spacing: 0.1em;
  text-shadow: 0 0 12px rgba(0, 255, 146, 0.4);
  font-variant-numeric: tabular-nums;
}

.cp-fix-btn,
.c6-fix-btn {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #22ffa6, #00c471);
  color: #03140c;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  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;
}

.cp-fix-btn:hover,
.c6-fix-btn: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);
}

.cp-fix-btn:disabled,
.c6-fix-btn:disabled {
  background: #2b2b2b;
  color: rgba(205, 205, 205, 0.45);
  box-shadow: 0 0 0 1px rgba(205, 205, 205, 0.12);
  filter: none;
  transform: none;
}

.cp-toast,
.c6-toast {
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(6, 6, 6, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 255, 146, 0.3);
}

/* ---------- THE RESULT POP-UP (cards, coins, dice, slot) ----------
   Win: green top line and glow. Lose / notice: quiet grey top line with a dark red light. */
.cf-modal,
.c3f-modal,
.dr-modal {
  box-sizing: border-box;
  min-width: 260px;
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 22px 13px;
  border: 1px solid var(--pr-line);
  border-top: 2px solid rgba(205, 205, 205, 0.4);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, var(--pr-crimson), rgba(0, 0, 0, 0) 78%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.97), rgba(6, 6, 6, 0.97));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), inset 0 0 22px rgba(205, 205, 205, 0.03);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.cf-modal:has(.cf-modal-win),
.c3f-modal:has(.c3f-modal-win),
.dr-modal:has(.dr-modal-win) {
  border-color: rgba(0, 255, 146, 0.4);
  border-top: 2px solid var(--pr-green);
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(0, 255, 146, 0.16), rgba(0, 0, 0, 0) 78%),
    linear-gradient(180deg, rgba(14, 22, 18, 0.97), rgba(5, 8, 7, 0.97));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), 0 0 26px rgba(0, 255, 146, 0.3), inset 0 0 22px rgba(0, 255, 146, 0.05);
}

.cf-modal-line1,
.c3f-modal-line1,
.dr-modal-line1 {
  font-size: 14px;
  letter-spacing: 0.03em;
  color: #ececec;
}

.cf-modal-line2,
.c3f-modal-line2,
.dr-modal-line2 {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(205, 205, 205, 0.1);
  line-height: 1.5;
  color: rgba(205, 205, 205, 0.7);
}

.cf-modal-line2.cf-modal-win,
.c3f-modal-line2.c3f-modal-win,
.dr-modal-line2.dr-modal-win {
  color: var(--pr-green);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 255, 146, 0.45);
}

@media (max-width: 768px) {
  .cf-modal,
  .c3f-modal,
  .dr-modal {
    min-width: 0;
    padding: 10px 14px 11px;
  }

  .cf-modal-line1,
  .c3f-modal-line1,
  .dr-modal-line1 {
    font-size: 12.5px;
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .cp-fix-btn,
  .c6-fix-btn,
  .cp-prediction,
  .c6-prediction {
    font-size: 14px;
  }
}
