/* ===============================================
   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;
  gap: 16px;
}

.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: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px 12px;
}

.db-guide-cell {
  min-width: 0;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 6px;
  padding: 6px 6px;
  background: rgba(6, 6, 6, 0.7);
  box-shadow: inset 0px 4px 30px 5px rgba(205, 205, 205, 0.05);
  box-sizing: border-box;
  overflow: hidden;
  /* scales with the window so the longest guide fits its 1/5-width cell; below ~1370px wide it wraps instead of being cut off */
  font-size: clamp(10px, calc((100vw - 408px) / 96), 13px);
  line-height: 1.25;
  color: rgba(205, 205, 205, 0.5);
  text-align: center;
}

.db-guide-item {
  min-width: 0;
}

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

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

.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;
}

.db-type-btn[data-side] {
  cursor: pointer;
}

.db-type-btn[data-side]:hover {
  filter: blur(2px);
}

.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;
}

/* ===== DESKTOP PAPERS: scrollable 2-row grid ===== */

.db-scroll-outer-d {
  flex-shrink: 0;
  width: 980px;
  height: 230px;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

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

.db-scroll-wrap-d {
  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-d::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.db-papers-d {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
}

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

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

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

/* ===== 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(0, 255, 146, 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;
}

/* ===== DESKTOP: two areas split by a vertical line =====
   left  = explanation + bet guide boxes
   right = bet slips (scroll when needed) + Fix & Next under the scroll frame
   (on the phone both wrappers are inert: display: contents) ===== */

.db-left,
.db-right {
  display: contents;
}

@media (min-width: 769px) {

  .db-body {
    padding: 36px 40px;
  }

  .db-content {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
  }

  .db-left {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 40px;
    overflow: hidden;
  }

  .db-right {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-left: 40px;
    border-left: 1px solid rgba(205, 205, 205, 0.2);
  }

  .db-guides {
    margin-top: auto;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .db-guide-cell {
    font-size: 12px;
  }

  .db-scroll-outer-d {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 120px;
    max-width: none;
  }

  .db-papers-d {
    display: grid;
    grid-template-columns: repeat(auto-fill, 150px);
    justify-content: space-between;
    gap: 26px 0;
  }
}

@media (min-width: 1401px) {
  .db-body {
    padding: 36px 150px;
  }
}

/* ===============================================
   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: 2-column grid, 4 rows (order kept) ===== */

  .db-guides {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  /* Some guides here are longer than a half-width cell: wrap instead of cutting them off. */
  .db-guide-cell {
    height: auto;
    min-height: 24px;
    padding: 4px 6px;
    font-size: 9px;
    white-space: normal;
  }

  .db-guide-item {
    overflow: visible;
    text-overflow: clip;
  }

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

  .db-scroll-outer-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;
  }
}
