body {
  margin: 0;
  padding: 0;
  background-color: #0c3823;
  background-image: radial-gradient(circle at center, #1b5e3c 0%, #0c3823 100%);
  color: #fff;
  font-family: sans-serif;
  overflow: hidden;
  touch-action: none;
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.dice-selector {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
}

.dice-option {
  border: 0;
  border-radius: 999px;
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #eff8f3;
  font-weight: 700;
  cursor: pointer;
}

.dice-option.active {
  background: #e8f9ef;
  color: #0c3823;
}

#testsLink {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 76px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #eff8f3;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
}

#testsLink:hover {
  background: rgba(0, 0, 0, 0.45);
}

#motionPermission {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e8f9ef;
  color: #0c3823;
  font-weight: 700;
  cursor: pointer;
}

#motionPermission.hidden {
  display: none;
}

.tests-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}

.tests-panel {
  width: min(760px, calc(100vw - 32px));
  background: rgba(0, 0, 0, 0.34);
  border-radius: 18px;
  padding: 18px;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
}

.tests-header {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tests-header a {
  color: #d8f3e4;
  text-decoration: none;
  font-weight: 700;
}

.tests-header a:hover {
  text-decoration: underline;
}

#runTests {
  border: 0;
  border-radius: 999px;
  min-width: 120px;
  height: 34px;
  padding: 0 14px;
  background: #e8f9ef;
  color: #0c3823;
  font-weight: 700;
  cursor: pointer;
}

#testResults {
  margin-top: 14px;
  display: block;
  color: #eff8f3;
  font-size: 14px;
  font-weight: 700;
}

#testResults.pass {
  color: #b4f4ca;
}

#testResults.fail {
  color: #ffd0d0;
}

#testDetails {
  margin-top: 10px;
  max-height: 48vh;
  overflow: auto;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: #dff5e8;
}

@media (max-width: 700px) {
  .dice-selector {
    top: 10px;
    left: 10px;
    gap: 5px;
    padding: 5px;
  }

  .dice-option {
    min-width: 32px;
    height: 28px;
    padding: 0 9px;
  }

  #testsLink {
    top: 10px;
    right: 10px;
    height: 28px;
    min-width: 68px;
    padding: 0 10px;
  }

  #motionPermission {
    width: calc(100vw - 26px);
    border-radius: 16px;
  }
}