@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/karla-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/young-serif-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  background: #22382f;
  font-family: "Karla", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #22382f;
}

body {
  color: #f2eada;
}

button {
  font: inherit;
}

.stage {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(1200px 800px at 50% 120%, #2e4b3f 0%, #22382f 55%, #1a2b24 100%);
}

.aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(720px, 130vw);
  height: min(720px, 130vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(166 75 34 / 28%) 0%, rgb(166 75 34 / 10%) 45%, transparent 70%);
  pointer-events: none;
  animation: cc-pulse 6s ease-in-out infinite;
}

#cc-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.roll-surface {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.roll-surface:focus-visible {
  outline: 3px solid #e8a87c;
  outline-offset: -7px;
}

.content {
  position: relative;
  z-index: 2;
  padding: 40px 24px;
  text-align: center;
  pointer-events: none;
  animation: cc-rise 0.9s ease-out both;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  border: 1px solid rgb(168 196 180 / 50%);
  border-radius: 999px;
  color: #a8c4b4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e8a87c;
  animation: cc-blink 2.2s ease-in-out infinite;
}

h1 {
  margin: 34px 0 0;
  color: #fcf8f1;
  font-family: "Young Serif", ui-serif, Georgia, serif;
  font-size: clamp(52px, 15vw, 132px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
  animation: cc-float 7s ease-in-out infinite;
}

.tagline {
  max-width: min(460px, 82vw);
  margin: 30px auto 0;
  color: #a8c4b4;
  font-size: clamp(15px, 4.2vw, 17px);
  line-height: 1.6;
  text-wrap: pretty;
}

.hint {
  margin: 42px 0 0;
  color: rgb(168 196 180 / 55%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cc-die {
  position: fixed;
  z-index: 50;
  color: #e8a87c;
  pointer-events: none;
  animation: cc-die-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.cc-die.is-critical {
  color: #e8c86a;
}

.cc-die.is-fumble {
  color: #c9573b;
}

.cc-die.is-leaving {
  animation: cc-die-out 0.4s ease-in both;
}

.die-spin {
  transform-origin: 50% 50%;
  animation: cc-die-shake 0.5s ease-out 1;
}

.die-svg {
  display: block;
  filter: drop-shadow(0 6px 22px rgb(0 0 0 / 45%));
}

.die-label {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
}

@keyframes cc-float {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes cc-pulse {
  0%,
  100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.06); }
}

@keyframes cc-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cc-blink {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes cc-die-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-200deg); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(14deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

@keyframes cc-die-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
}

@keyframes cc-die-shake {
  0%,
  100% { transform: rotate(0deg); }
  25% { transform: rotate(9deg); }
  50% { transform: rotate(-8deg); }
  75% { transform: rotate(5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .aura,
  .content,
  .status-dot,
  h1,
  .cc-die,
  .cc-die.is-leaving,
  .die-spin {
    animation: none;
  }
}
