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

html, body {
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen {
  display: block;
  image-rendering: pixelated;
  background: #000;
}

/* ---- 右側ボタン ---- */
.ui-right {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ui-btn {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, .55);
  border-radius: 10px;
  background: rgba(20, 24, 34, .5);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ui-btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: rgba(255, 255, 255, .85);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-btn:active { background: rgba(80, 110, 170, .65); }
.ui-btn.on     { border-color: #ffd75e; }
.ui-btn.on svg { stroke: #ffd75e; }

/* ---- 円形パッド ---- */
/* 指で押す物なので大きめに。150px から広げました（2026-09-08 菅谷様のご指摘・2026-09-11 共有側へ移植）。
   まん中のつまみ（56px）は「はなす・しらべる」、外側の4方向は1マス移動です。 */
.pad {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
}

.pad-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .10);
}

.pad-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .18);
}

.pad-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 11px solid transparent;
  opacity: .75;
}
.pad-arrow.up    { top: 8px;    left: 50%; margin-left: -9px; border-bottom-color: #fff; border-top-width: 0; }
.pad-arrow.down  { bottom: 8px; left: 50%; margin-left: -9px; border-top-color: #fff;    border-bottom-width: 0; }
.pad-arrow.left  { left: 8px;   top: 50%;  margin-top: -9px;  border-right-color: #fff;  border-left-width: 0; }
.pad-arrow.right { right: 8px;  top: 50%;  margin-top: -9px;  border-left-color: #fff;   border-right-width: 0; }

.devnote {
  position: absolute;
  top: 6px;
  left: 8px;
  color: rgba(255, 255, 255, .45);
  font-size: 11px;
  letter-spacing: .05em;
}

/* 名前入力・複数選択・見本の画面が出ているあいだは、パッドと右のボタンを隠します。
   画面いっぱいに表や絵が出るので、指で直接押せるようにするためです。 */
#stage.input-open .pad,
#stage.input-open .ui-right { display: none; }
