/* ブラウザゲーム共通スタイル */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--okg-bg, #f5f5f5);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--okg-font, sans-serif);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.okg-stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  container-type: size;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .okg-stage {
    width: min(100vw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100vw * 9 / 16));
  }
}

.okg-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: pointer;
  outline: none;
}

.okg-ui {
  position: absolute;
  top: 2.6%;
  right: 1.4%;
  display: flex;
  gap: 8px;
  gap: 1cqw;
}

.okg-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  width: clamp(28px, 4.8cqw, 52px);
  height: clamp(28px, 4.8cqw, 52px);
  padding: 0;
  border: 2px solid var(--okg-primary, #999);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--okg-accent, #555);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 var(--okg-shadow, rgba(0, 0, 0, 0.2));
  transition: transform 0.1s;
}

.okg-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--okg-shadow, rgba(0, 0, 0, 0.2));
}

.okg-btn:focus-visible {
  outline: 3px solid var(--okg-focus, #333);
  outline-offset: 2px;
}

.okg-btn svg {
  width: 58%;
  height: 58%;
}

.okg-noscript {
  padding: 24px;
  color: var(--okg-text, #333);
  text-align: center;
}

/* キャプチャ撮影用（?capture を付けて開くとボタンを隠す） */
.okg-capture .okg-ui {
  display: none;
}
