:root {
  --bg: #fff5f8;
  --card: #ffffff;
  --text: #4a3640;
  --muted: #9a8790;
  --accent: #ff7aa8;
  --accent-dark: #e85c8e;
  --line: #f3d6e1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  display: flex;
  justify-content: center;
}

.screen {
  display: none;
  width: 100%;
  max-width: 560px;
  padding: 56px 16px 40px;  /* 上は右上の🔊ボタンと重ならない分あける */
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.screen.active { display: flex; }

h1 { margin: 8px 0 0; font-size: 2rem; color: var(--accent-dark); }
h2 { margin: 0; color: var(--accent-dark); }
h3 { margin: 10px 0 0; font-size: 1rem; align-self: flex-start; }
.muted { color: var(--muted); margin: 0; }
.hint { font-size: .85rem; }
.row { display: flex; gap: 10px; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: #ddc7cf; cursor: default; }
.btn.big { padding: 14px 40px; font-size: 1.2rem; }
.btn.ghost { background: transparent; color: var(--muted); padding: 6px 8px; }
/* 体験版の「ホームページに戻る」 */
.home-link { display: inline-block; text-decoration: none; font-size: .9rem; }
.home-link:hover { background: transparent; color: var(--accent-dark); text-decoration: underline; }

/* 選択肢ボタン */
.choices {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.choice {
  position: relative;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.choice .icon { font-size: 2rem; line-height: 1; }
.choice img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.choice.selected { border-color: var(--accent); background: #ffe8f0; }
.choice .best { font-size: .7rem; color: var(--muted); }
.choice.locked { opacity: .6; }

/* 体験版：製品版へのリンク */
.sales { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sales:empty { display: none; }
.sales .row { flex-wrap: wrap; justify-content: center; }
a.btn { text-decoration: none; display: inline-block; }

/* 画像・動画表示エリア */
/* 画像サイズ 1024×1360（縦長）に合わせた枠。画面の高さに収まるよう自動で縮小 */
.media-box {
  width: min(100%, calc(68vh * 1024 / 1360));
  aspect-ratio: 1024 / 1360;
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.media-box.small { width: min(100%, calc(60vh * 1024 / 1360)); }
.media-box img, .media-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
/* 動画（768×1024 = 3:4）は枠（1024×1360）とほぼ同じ比率なので、
   余白が出ないよう枠いっぱいに表示（はみ出しは上下わずか約2px） */
.media-box video { object-fit: cover; }
/* 切り替え中の新しい動画は前の画面の上に重ねる（映るまでは透明なので前の画面が見えたまま） */
.media-box video.incoming { position: absolute; inset: 0; }
.placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; }
.placeholder .icon { font-size: 5rem; line-height: 1; }
.media-box.small .placeholder .icon { font-size: 4rem; }
.placeholder .path { font-size: .75rem; color: var(--muted); word-break: break-all; }

/* くすぐり画面 */
.play-head { width: 100%; display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
#play-timer { color: var(--muted); font-variant-numeric: tabular-nums; }

.gauge {
  width: 100%;
  height: 18px;
  background: #f6e3ea;
  border-radius: 999px;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffb3cc, var(--accent), #ff4d6d);
  transition: width .1s linear;
}

.bubble {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px 16px;
  min-height: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  width: 100%;
}
.bubble.pop { animation: pop .25s ease; }
@keyframes pop { 0% { transform: scale(.94); } 100% { transform: scale(1); } }

.stage {
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: none;
}
.stage .media-box { border-style: solid; }
.stage.shake .media-box { animation: shake .18s linear infinite; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-3px, 1px) rotate(-.6deg); }
  75% { transform: translate(3px, -1px) rotate(.6deg); }
}

.hand-cursor {
  position: absolute;
  left: 0; top: 0;
  font-size: 2.6rem;
  pointer-events: none;
  transform: translate(-30%, -80%);
  display: none;
  z-index: 3;
}
.hand-cursor img { width: 64px; height: 64px; object-fit: contain; }

.float-text {
  position: absolute;
  pointer-events: none;
  font-weight: bold;
  color: var(--accent-dark);
  animation: floatUp .9s ease-out forwards;
  z-index: 2;
  white-space: nowrap;
}
@keyframes floatUp {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, -50px); }
}

.bubble.static { min-height: auto; }

/* 声のオン/オフ */
.sound-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--card);
  font-size: 1.2rem;
  cursor: pointer;
}
