/* ===============================================
   RESET
   =============================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

* {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'JetBrains Mono', monospace;
}

html {
  overscroll-behavior: contain;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: always;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

img, picture, video, canvas, svg, embed, iframe, object, audio {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===============================================
   FONTS
   =============================================== */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../Source/Font/JetBrainsMono-2.304/fonts/webfonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../Source/Font/JetBrainsMono-2.304/fonts/webfonts/JetBrainsMono-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../Source/Font/JetBrainsMono-2.304/fonts/webfonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ===============================================
   HEADER / FOOTER BREAKPOINT SWITCH
   =============================================== */

.header-d-wrap,
.header-p-wrap,
.footer-d-wrap,
.footer-p-wrap {
  width: 100%;
  flex-shrink: 0;
}

.header-p-wrap,
.footer-p-wrap {
  display: none;
}

.headerc-d-logo img,
.headerc-p-logo img {
  max-width: none;
  height: 148%;
}

/* ===============================================
   LAYOUT
   =============================================== */

html, body {
  height: 100%;
}

body {
  background: #090909;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

.db-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 32px;
  padding: 36px 150px;
  box-sizing: border-box;
  overflow: hidden;
}

.db-title {
  flex-shrink: 0;
  width: 100%;
  font-weight: 700;
  font-size: 40px;
  color: #3d0018;
  text-shadow: 0px 1px 1px rgba(0, 255, 146, 0.5);
}

.db-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.db-desc-d {
  flex-shrink: 0;
  width: 100%;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.54px;
  color: #cdcdcd;
}

.db-desc-p {
  display: none;
  flex-shrink: 0;
  width: 100%;
  font-weight: 400;
  font-size: 14px;
  color: #cdcdcd;
}

.db-slip-rule {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

/* ===== BET GUIDES ===== */

.db-guides {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  gap: 40px;
}

.db-guide-cell {
  flex: 1 1 0;
  min-width: 0;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 6px 10px;
  background: rgba(6, 6, 6, 0.7);
  box-shadow: inset 0px 4px 30px 5px rgba(205, 205, 205, 0.05);
  box-sizing: border-box;
  font-size: 14px;
  color: rgba(205, 205, 205, 0.5);
  text-align: center;
  white-space: nowrap;
}

.db-guide-item b {
  font-weight: 400;
  color: #cdcdcd;
}

/* ===== BET PAPERS ===== */

.db-papers-d {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-card,
.db-card-p {
  font-family: 'JetBrains Mono', monospace;
}

.db-card {
  flex-shrink: 0;
  width: 150px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 14px;
  background: rgba(6, 6, 6, 0.7);
  box-shadow: inset 0px 0px 20px 0px rgba(205, 205, 205, 0.05);
  box-sizing: border-box;
}

.db-card-mult {
  width: 100%;
  color: #00ff92;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
}

.db-card-types {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  text-align: center;
  white-space: nowrap;
}

.db-card-types:has(.db-type-btn:only-child) {
  justify-content: center;
}

.db-type-btn {
  color: #cdcdcd;
  font-weight: 700;
  font-size: inherit;
  font-family: inherit;
  text-shadow: 0px 1px 3px rgba(0, 255, 146, 0.5);
  opacity: 0.4;
  transition: opacity 0.3s ease, filter 0.7s ease;
}

/* Two-choice cards (High/Low, Odd/Even): the chosen side gets a green stroke on its letters. */
.db-type-btn[data-side] {
  cursor: pointer;
}

.db-type-btn[data-side].db-type-selected {
  -webkit-text-stroke: 1px #00ff92;
  paint-order: stroke fill;
}

.db-type-selected {
  opacity: 1;
}

.db-indicator {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.db-amount-row {
  width: 100%;
  text-align: center;
}

.db-amount-value {
  color: #cdcdcd;
  font-weight: 400;
  font-size: 22px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.db-amount-value.db-active {
  opacity: 1;
}

.db-sign-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-sizing: border-box;
}

.db-sign {
  font-size: 30px;
  line-height: 1;
  color: #cdcdcd;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: filter 0.7s ease;
}

.db-sign:hover {
  filter: blur(2px);
}

.db-mbet {
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #cdcdcd;
  text-shadow: 0px 2px 2px #3d0018;
}

/* ===== BET SLIP (phone, horizontal) ===== */

.db-card-p {
  position: relative;
  width: 220px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: rgba(6, 6, 6, 0.7);
  box-shadow: inset 0px 0px 20px 0px rgba(205, 205, 205, 0.05);
  box-sizing: border-box;
}

.db-row-head-p {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-row-head-p .db-card-types {
  width: auto;
  justify-content: flex-start;
  gap: 24px;
}

.db-row-head-p .db-card-mult {
  width: auto;
}

.db-row-indicator-p {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.db-mbet-p {
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #cdcdcd;
  text-shadow: 0px 2px 2px #3d0018;
}

/* ===== FIX BUTTON ===== */

.db-fix-btn {
  flex-shrink: 0;
  width: 170px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
  border: 3px solid #000000;
  background: #00ff92;
  color: #000000;
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  box-shadow: inset 0px 0px 10px 5px black;
  transition: filter 0.7s ease;
  box-sizing: border-box;
}

.db-fix-btn:hover {
  filter: blur(2px);
}

.db-fix-btn-p {
  display: none;
}

/* ===== MOBILE SCROLL WRAPPERS (inert on desktop) ===== */

.db-scroll-outer {
  display: none;
}

/* ===== TOAST ===== */

.db-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(10px);
  background: #000000;
  border: 1px solid #00ff92;
  color: #00ff92;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  box-shadow: 0px 0px 10px 0px rgba(0, 255, 146, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2000;
  white-space: nowrap;
}

.db-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== FIX & NEXT CONFIRM POPUP ===== */

.db-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2100;
  box-sizing: border-box;
}

.db-confirm-overlay.is-open {
  display: flex;
}

.db-confirm-box {
  width: 360px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 30px 24px;
  background: #090909;
  border: 1px solid #00ff92;
  box-shadow: 0px 0px 20px 0px rgba(245, 197, 66, 0.5);
  font-family: 'JetBrains Mono', monospace;
  color: #cdcdcd;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.db-confirm-question {
  font-weight: 400;
  font-size: 15px;
  color: #cdcdcd;
  line-height: 1.5;
  text-align: center;
}

.db-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.db-confirm-yes,
.db-confirm-no {
  flex: 0 1 96px;
  box-sizing: border-box;
  border: 2px solid #000000;
  padding: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 12px;
  box-shadow: inset 0px 0px 6px 3px black;
  cursor: pointer;
}

.db-confirm-yes {
  background: #00ff92;
  color: #090909;
}

.db-confirm-no {
  background: #cdcdcd;
  color: #090909;
}

.db-confirm-yes:hover,
.db-confirm-no:hover {
  filter: blur(1.5px);
  transition: all 0.7s ease;
}

/* ===============================================
   RESPONSIVE - PHONE (max-width: 768px)
   =============================================== */
@media (max-width: 768px) {

  .header-d-wrap,
  .footer-d-wrap {
    display: none;
  }

  .header-p-wrap,
  .footer-p-wrap {
    display: block;
  }

  /* The whole page is exactly one screen tall: header and footer stay put and
     only the box holding the bet slips scrolls, with Fix & Next always visible
     under it. (On a screen too short even for that, the middle part - not the
     header/footer - scrolls as a last resort.) */
  html, body {
    height: 100%;
    overflow: hidden;
  }

  .db-body {
    gap: 14px;
    padding: 16px 20px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .db-content {
    justify-content: flex-start;
    gap: 12px;
  }

  .db-title {
    font-size: 30px;
  }

  .db-desc-d {
    display: none;
  }

  .db-desc-p {
    display: block;
  }

  /* ===== BET GUIDES: stacked column ===== */

  .db-guides {
    flex-direction: column;
    gap: 10px;
  }

  /* Long guide text wraps to a second line instead of being cut off. */
  .db-guide-cell {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 24px;
    flex-wrap: wrap;
    gap: 2px 16px;
    padding: 4px 10px;
    white-space: normal;
  }

  /* ===== BET PAPERS: desktop row hidden, phone scroll shown ===== */

  .db-papers-d,
  .db-fix-btn-d {
    display: none;
  }

  .db-scroll-outer {
    display: flex;
    flex: 1 1 auto;
    min-height: 120px;
    width: 270px;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
  }

  .db-scroll-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    height: 100%;
  }

  .db-scroll-wrap {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .db-scroll-wrap::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .db-scroll-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
  }

  .db-fix-btn-p {
    display: flex;
  }

  .db-scrollbar-track {
    flex-shrink: 0;
    align-self: stretch;
    width: 4px;
    padding: 4px 1px;
    box-sizing: border-box;
    background: #000000;
    position: relative;
  }

  .db-scrollbar-thumb {
    position: absolute;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: #00ff92;
    filter: blur(0.5px);
    cursor: pointer;
  }
}

/* Phone: the - / + of a bet slip are small glyphs, so their tap target was only the
   glyph itself. An invisible extension of about 15% on every side-to-side and
   top-to-bottom edge makes them easier to hit, without moving or enlarging anything. */
@media (max-width: 768px) {
  .db-sign {
    position: relative;
  }

  .db-sign::after {
    content: '';
    position: absolute;
    inset: -2px -1.5px;
  }
}

/* ===== DICE 1 (desktop): the three bet slips sit close together, in the middle (the same gap as the coin
   bet page). Each guide box above gets the slip's width and its two parts stand on two lines. ===== */
@media (min-width: 769px) {
  main[data-kd-slips="close"] .db-guides,
  main[data-kd-slips="close"] .db-papers-d {
    justify-content: center;
    gap: 20px;
  }

  main[data-kd-slips="close"] .db-guides { align-items: stretch; }

  main[data-kd-slips="close"] .db-guide-cell {
    flex: 0 0 150px;
    width: 150px;
    height: auto;
    min-height: 24px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 6px 6px;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
  }
}
