* {
  margin: 0;
  padding: 0;
  vertical-align: baseline;
}
html {
  font-family: system-ui, sans-serif;
}
body {
  display: flex;
  height: 100vh;
  width: 100%;
  background-image: url(./background.png);
  background-repeat: repeat;
}
.container {
  margin: auto;
  align-items: center;
  justify-content: center;
  display: grid;
  grid-template-columns: 1fr;
}
#dice-canvas {
  /* The canvas's pixel size is driven by dice.js (layoutAndDraw resizes it
     based on how many dice are visible). CSS just controls its placement
     and a max-width so it scales down on narrow viewports. */
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Loading overlay shown while the dice model + Draco decoder download. */
.dice-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fafafa;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.02em;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.dice-loader-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: dice-loader-spin 0.9s linear infinite;
}
@keyframes dice-loader-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dice-loader-spinner { animation-duration: 2.4s; }
}

/* FPS / frame-time readout, pinned to the top-left of the viewport so it's
   visible on a TV without needing DevTools. */
.dice-fps {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.72);
  color: #0f0;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  letter-spacing: 0.5px;
}
.dice-fps span { display: inline-block; min-width: 3em; text-align: right; }
