* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: #0b5963;
  color: #f5fff8;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
  touch-action: none;
}

#gameRoot {
  position: fixed;
  inset: 0;
}

#sceneCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.sr-status {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 22, 30, 0.55);
  backdrop-filter: blur(8px);
}

.overlay.hidden {
  display: none;
}

.overlay-panel {
  width: min(410px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 94, 96, 0.96), rgba(5, 38, 51, 0.96));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  padding: 26px;
  text-align: center;
}

.overlay-panel.small {
  width: min(310px, 100%);
}

.result-gem {
  display: inline-block;
  width: 54px;
  height: 54px;
  border: 6px solid #f2d47d;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.9) 0 10%, transparent 11%),
    linear-gradient(145deg, #68db40, #2198ff);
  box-shadow: 0 0 26px rgba(184, 255, 115, 0.48), inset 0 -12px 18px rgba(0, 0, 0, 0.2);
}

.result-gem.paused {
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.9) 0 10%, transparent 11%),
    linear-gradient(145deg, #2198ff, #9947ef);
}

.overlay h1 {
  margin-top: 13px;
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1.05;
  font-weight: 950;
}

.overlay strong {
  display: block;
  margin-top: 12px;
  color: #d9ff69;
  font-size: clamp(44px, 12vw, 68px);
  line-height: 0.95;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.overlay p {
  margin-top: 10px;
  color: rgba(245, 255, 248, 0.76);
  font-size: 15px;
  line-height: 1.45;
}

.overlay-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.overlay button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 0 20px;
  background: linear-gradient(180deg, #5d89ff, #315fd6);
  color: #ffffff;
  font: 900 14px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

.overlay button + button {
  background: rgba(255, 255, 255, 0.1);
}
