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

/* Padding and borders should not change an element's declared size. */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Browser margin/padding defaults vary wildly across elements and vendors.
   Start from zero - handle spacing intentionally via the design system. */
* {
  margin: 0;
  padding: 0;
}

/* Prevents flex/grid children from overflowing their container.
   The default min-width: auto on flex and grid children causes overflow bugs
   that are notoriously confusing to debug. */
* {
  min-width: 0;
}

/* Hidden means hidden: !important is warranted here. */
[hidden] {
  display: none !important;
}

/* Allows CSS transitions to/from intrinsic keyword sizes (auto, min-content, etc.).
   Only meaningful for users who haven't requested reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

/* Prevent adjustments of font size after orientation changes in iOS. */
html {
  -webkit-text-size-adjust: 100%; /* Safari, iOS Safari */
  text-size-adjust: 100%;         /* Chrome, Edge, Firefox Android */
}

/* Ensures the page occupies at least the full viewport.
   dvh accounts for mobile browser UI (address bar, navigation)
   and overrides the vh fallback in browsers that support it. */
body {
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  min-height: 100svh;
}

/* Scroll events captured by the scrolling area you're pointing at, by default. */
html {
  overscroll-behavior: contain;
}

/* Antialiased rendering looks better on high-DPI (retina) screens.
   On lower-DPI displays, subpixel antialiasing (the default) can be
   sharper, so this is slightly lossy on older monitors.
   Enable kerning and ligatures at small font-sizes by default. */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: always;
  text-rendering: optimizeLegibility;
}

/* A unitless line-height avoids inheritance math issues.
   The smaller default line-height for h-elements avoids excessive
   line-height when your design system (likely) applies larger fonts.
   WCAG recommends at least 1.5 for body copy. */
body {
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
}

/* Prevents long URLs or unbreakable strings from blowing out their container. */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Smarter line-breaking:
   'pretty' avoids widows (lone words on the last line of a paragraph).
   'balance' distributes heading text more evenly across lines.
   Harmless in browsers that don't support them. */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/* Headings carry semantic meaning, not visual weight.
   h1–h6 sizing and boldness should come from your design system. */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

/* Inline embedded content has a gap at the bottom caused by baseline alignment.
   Block display removes it; max-width prevents overflow.
   height: auto preserves aspect ratio when max-width constrains the width. */
img, picture, video, canvas, svg, embed, iframe, object, audio {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Exemption for SVG icons (Heroicons/Lucide/Phosphor, etc.) with explicit sizes:
   these should not be constrained. */
svg[width][height] {
  max-width: revert;
}

/* Strips visual chrome from buttons so they can be styled from scratch. */
button {
  background: none;
  border: none;
}

/* Form elements use OS-level fonts and ignore font inheritance by default. */
input, button, textarea, select {
  font: inherit;
}

/* Strips OS-level native styling from interactive elements.
   Leaves border and background intact, providing accessibility by default.
   Visual styling should be handled by the design system. */
input, button, textarea, select {
  -webkit-appearance: none;
  appearance: none;
}

/* Anything interactive should signal clickability.
   'button' attribute targets [type="button"], [type="submit"], etc. */
button,
[role="button"],
label,
summary,
select {
  cursor: pointer;
}

/* Inherit color by default so links don't always appear in browser-default blue.
   Text-decoration is intentionally left as underlined for accessibility. */
a {
  color: inherit;
}

/* Removes bullets/numbers.
   list markers should be an explicit choice, not a default. */
ul, ol {
  list-style: none;
}

/* Tables default to separated borders with spacing between cells.
   For any custom table design, you'll want to collapse the borders. */
table {
  border-collapse: collapse;
}

/* Browsers apply bold to <th> elements.
   Boldness in tables should be controlled by your design system. */
th {
  font-weight: inherit;
}

/* Fieldsets have a surprise border and padding that most UIs don't want. */
fieldset {
  border: none;
  padding: 0;
}

/* More of a normalization, but these are inconsistently styled in some browsers. */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* Ensures monospace elements render at the same size as surrounding text. */
pre, code, kbd, samp {
  font-family: monospace;
  font-size: inherit;
}

/* Browser-generated quotation marks are rarely wanted in a design system. */
blockquote,
q {
  quotes: none;
}
blockquote::before,
blockquote::after,
q::before,
q::after {
  content: none;
}

/* Creates an explicit stacking context on the app root.
   Prevents z-index bleed from portals, modals, or tooltips
   from leaking out unexpectedly. */
#root {
  isolation: isolate;
}

/* ===============================================
   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-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;
}

/* The reset's `img { max-width: 100% }` fights the header logo's own
   fill-and-crop sizing (width/height: 148% inside an overflow:hidden circle).
   Exempt it so the component renders exactly as it does standalone. */
.header-d-logo img,
.header-p-logo img,
.headerc-d-logo img,
.headerc-p-logo img {
  max-width: none;
  height: 148%;
}

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

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

html, body {
  height: 100%;
}

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

.main-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 0;
  overflow: hidden;
}

.poster {
  width: 100%;
  flex: 1 1 auto;
  min-height: 100px;
  max-height: 300px;
  margin-bottom: 30px;
  overflow: hidden;
  position: relative;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.poster::before,
.poster::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: none;
  z-index: 1;
}

.poster::before {
  top: 0;
  background: linear-gradient(to bottom, #090909, transparent);
}

.poster::after {
  bottom: 0;
  background: linear-gradient(to top, #090909, transparent);
}

/* Left/right edges of the looping banner fade the same way the top/bottom
   ones do (::before/::after) - real elements since a box only gets two
   pseudo-elements. */
.poster-fade-l,
.poster-fade-r {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  z-index: 1;
}

.poster-fade-l {
  left: 0;
  background: linear-gradient(to right, #090909, transparent);
}

.poster-fade-r {
  right: 0;
  background: linear-gradient(to left, #090909, transparent);
}

.poster .poster-phone {
  display: none;
}

.boards {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 150px;
  box-sizing: border-box;
}

/* ===== BETBOARD ===== */
.betboard {
  width: 450px;
  height: 130px;
  flex-shrink: 0;
  background: #060606;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 0 6px black;
  position: relative;
}

.betboard::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 10px 4px rgba(205, 205, 205, 0.1);
  pointer-events: none;
}

.betboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  height: 16px;
  position: relative;
  font-size: 10px;
  font-weight: 700;
}

.betboard-row::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.betboard-row.row-title {
  background: rgba(61, 0, 24, 0.5);
  color: #cdcdcd;
}

.betboard-row.row-title::after {
  box-shadow: inset 0 0 8px rgba(205, 205, 205, 0.1);
}

.betboard-row.row-data {
  background: #cdcdcd;
  color: #090909;
  border: 1px solid black;
}

.betboard-row.row-data::after {
  box-shadow: inset 0 0 8px black;
}

.betboard-row .col-username { width: 60px; }
.betboard-row .col-game { width: 36px; }
.betboard-row .col-bet { width: 30px; }
.betboard-row .col-mult { width: 24px; }
.betboard-row .col-credit { width: 60px; }

.betboard-row-6 {
  display: none;
}

/* ===== TOTALBOARD ===== */
.totalboard {
  width: 450px;
  height: 130px;
  flex-shrink: 0;
  background: #060606;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 0 6px black;
  position: relative;
}

.totalboard::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 10px 4px rgba(205, 205, 205, 0.1);
  pointer-events: none;
}

.totalboard-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.totalboard-cell {
  width: 210px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 16px;
  font-size: 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.totalboard-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.totalboard-cell.cell-title {
  background: rgba(61, 0, 24, 0.5);
  color: #cdcdcd;
  font-weight: 400;
}

.totalboard-cell.cell-title::after {
  box-shadow: inset 0 0 8px rgba(205, 205, 205, 0.1);
}

.totalboard-cell.cell-data {
  background: #cdcdcd;
  color: #090909;
  font-weight: 700;
  border: 1px solid black;
  padding: 4px 8px;
}

.totalboard-cell.cell-data::after {
  box-shadow: inset 0 0 8px black;
}

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

  html, body {
    height: auto;
  }

  body {
    display: block;
    overflow: visible;
    height: auto;
  }

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

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

  .main-body {
    flex: none;
    justify-content: flex-start;
    padding: 36px 0;
    overflow: visible;
  }

  .poster {
    flex: none;
    height: 200px;
    max-height: none;
    margin-bottom: 47px;
  }

  .poster img {
    object-fit: cover;
  }

  .poster .poster-desktop {
    display: none;
  }

  .poster .poster-phone {
    display: block;
  }

  .poster-fade-l,
  .poster-fade-r {
    width: 30px;
  }

  .boards {
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 0 20px;
  }

  .betboard {
    width: 352px;
    height: 150px;
    padding: 8px;
    box-shadow: 0 0 4.8px black;
  }

  .betboard::after {
    box-shadow: inset 0 0 8px 3.2px rgba(205, 205, 205, 0.1);
  }

  .betboard-row {
    height: 15px;
    padding: 3.2px 6.4px;
  }

  .betboard-row.row-data {
    border-width: 0.8px;
  }

  .betboard-row.row-data::after {
    box-shadow: inset 0 0 6.4px black;
  }

  .betboard-row-6 {
    display: flex;
  }

  .betboard-row-6-desktop {
    display: none;
  }

  .totalboard {
    width: 352px;
    height: 150px;
    padding: 8px;
    box-shadow: 0 0 4.8px black;
  }

  .totalboard::after {
    box-shadow: inset 0 0 8px 3.2px rgba(205, 205, 205, 0.1);
  }

  .totalboard-cell {
    width: 164px;
  }
}
