:root {
  --dice-blue: #155ee8;
  --dice-fill: #a9cdf7;
  --dice-fill-selected: #6596d0;
  --dice-axis: #111;
  --dice-guide: #9aa3ad;
}

.dice-main {
  width: 100%;
  min-height: calc(100vh - 110px);
  display: grid;
  place-items: center;
  padding: clamp(.35rem, 1.4vw, 1.25rem) 0;
  overflow: hidden;
}

.dice-chart-wrap {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: stretch;
  align-items: center;
  overflow: hidden;
}

.dice-chart {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: calc(100vh - 275px);
  overflow: visible;
  user-select: none;
  touch-action: none;
}

.dice-bars {
  fill: var(--dice-fill);
  stroke: var(--dice-blue);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}

.dice-bars-selected {
  fill: var(--dice-fill-selected);
  stroke: var(--dice-blue);
  pointer-events: none;
}

.dice-selection {
  visibility: hidden;
  fill: none;
  stroke: #155ee8;
  stroke-width: 1.4;
  stroke-dasharray: 7 6;
  stroke-linecap: butt;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.dice-selection.visible {
  visibility: visible !important;
}

.dice-axis {
  stroke: var(--dice-axis);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.dice-tick {
  stroke: var(--dice-axis);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.dice-tick-label {
  fill: #111;
  font: 23px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.dice-guides {
  display: none;
}

.dice-guides.visible {
  display: block;
}

.dice-guide {
  stroke: var(--dice-guide);
  stroke-width: 1.5;
  stroke-dasharray: 6 7;
  opacity: .72;
  vector-effect: non-scaling-stroke;
}

.dice-hit-area {
  fill: transparent;
  cursor: crosshair;
}

.dice-hit-area:focus-visible {
  outline: none;
}


.dice-count {
  display: block;
  min-height: 1.1em;
  margin-bottom: -.28em;
  color: var(--dice-blue);
  font: 800 clamp(2.2rem, 4.6vw, 4.8rem)/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  text-align: center;
  user-select: none;
}

.dice-percentage {
  display: block;
  min-height: 1.1em;
  margin-top: -.34em;
  visibility: hidden;
  color: var(--dice-blue);
  font: 800 clamp(2.2rem, 4.6vw, 4.8rem)/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  text-align: center;
  user-select: none;
}

.dice-percentage.visible {
  visibility: visible;
}

@media (max-width: 700px) {
  .dice-main {
    min-height: calc(100vh - 80px);
    padding: .15rem .15rem .5rem;
  }

  .dice-chart {
    max-height: calc(100vh - 235px);
  }

  .dice-tick-label {
    font-size: 28px;
  }

  .dice-count {
    font-size: clamp(2.2rem, 10vw, 3.8rem);
  }

  .dice-percentage {
    font-size: clamp(2.2rem, 10vw, 3.8rem);
  }
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

.bar {
  flex: 0 0 auto;
}

.dice-main {
  flex: 1 1 auto;
  min-height: 0;
}
