.standalone-game {
  margin: 0;
  min-height: 100vh;
  background: #f3f7f4;
  color: #28312d;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.game-shell {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 10px;
}

.game-panel {
  display: grid;
  gap: 8px;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}

.game-hud div {
  border: 1px solid #cddbd3;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 82%),
    0 4px 12px rgb(36 49 44 / 7%);
  padding: 6px 8px;
}

.game-hud span {
  display: block;
  color: #66706a;
  font-size: 0.75rem;
  font-weight: 700;
}

.game-hud strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(0.98rem, 3.4vw, 1.25rem);
}

.game-hud .die-chip {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  border: 2px solid var(--die-chip-border, #cddbd3);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 22%, rgb(255 255 255 / 44%) 0 22%, transparent 24%),
    linear-gradient(180deg, rgb(255 255 255 / 24%) 0%, transparent 42%),
    var(--die-chip-fill, #ffffff);
  box-shadow:
    inset 0 -5px 0 rgb(0 0 0 / 15%),
    inset 0 1px 0 rgb(255 255 255 / 58%),
    0 3px 8px rgb(35 31 25 / 14%);
  color: var(--die-chip-ink, #24312c);
  line-height: 1;
  padding: 2px 6px;
  text-shadow: 0 1px 1px rgb(0 0 0 / 22%);
}

.dicezzle-game-canvas {
  width: 100%;
  height: clamp(430px, 55svh, 560px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  background: #f3f7f4;
  touch-action: none;
  overscroll-behavior: contain;
}

.dicezzle-game-canvas canvas {
  display: block;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-actions,
.result-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-actions button,
.result-panel__actions button,
.tutorial-hint button {
  min-height: 44px;
  border: 1px solid #b7c9b2;
  border-radius: 8px;
  background: #ffffff;
  color: #23342e;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 14px;
}

.game-actions button:first-child,
.result-panel__actions button:first-child {
  background: #315f50;
  border-color: #315f50;
  color: #ffffff;
}

.tutorial-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  border: 1px solid #d7c66a;
  border-radius: 8px;
  background: #fff8cf;
  color: #35423b;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.game-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #23342e;
  color: #ffffff;
  padding: 10px 16px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgb(35 52 46 / 20%);
}

.result-panel {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  background: rgb(36 49 44 / 42%);
  padding: 18px;
}

.result-panel__inner {
  width: min(100%, 430px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 18px 48px rgb(35 31 25 / 24%);
}

.result-panel__eyebrow {
  margin: 0 0 4px;
  color: #657166;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-panel h2 {
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 7vw, 2.1rem);
}

.result-panel__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.result-panel__stats div {
  border: 1px solid #d8e5dd;
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
}

.result-panel__stats dt {
  color: #6d756f;
  font-size: 0.76rem;
  font-weight: 800;
}

.result-panel__stats dd {
  margin: 2px 0 0;
  font-size: 1.08rem;
  font-weight: 900;
}

.result-panel__share-text {
  white-space: pre-wrap;
  border: 1px dashed #aac7b8;
  border-radius: 8px;
  background: #f3f7f4;
  padding: 10px;
  color: #30342f;
  font: 0.86rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[hidden] {
  display: none !important;
}

@media (max-width: 430px) {
  .game-shell {
    padding: 6px;
    gap: 8px;
  }

  .game-hud {
    gap: 6px;
  }

  .game-hud div {
    padding: 5px 6px;
  }

  .game-hud span {
    font-size: 0.68rem;
  }

  .game-hud strong {
    font-size: 1rem;
  }

  .dicezzle-game-canvas {
    height: clamp(430px, 53svh, 460px);
  }

  .tutorial-hint {
    gap: 8px;
    padding: 7px 8px;
    font-size: 0.78rem;
  }

  .tutorial-hint button {
    min-height: 34px;
    padding: 0 10px;
  }
}
