/* ブラウザで遊ぶページ /play/<id>/（tools/home/play.py・GCWEB-1）。暗い形は作らない（game-create.jp の決まり）
   PC（1024px 以上）: 縦長のスマホの枠にゲーム・左右に広告の枠。スマホ・タブレット: タイトルの絵と「遊ぶ」→ 画面いっぱいで遊ぶ（12/1 利用者の案・SC） */
.play { padding-bottom: 48px; }
.play-head { display: flex; align-items: center; gap: 14px; margin: 8px auto 16px; width: min(100% - 32px, 420px); }
.play-head img { width: 56px; height: 56px; border-radius: 14px; }
.play-head .kind { margin: 0; font-size: 14px; font-weight: 700; color: var(--felt); }
.play-head h1 { margin: 0; font-weight: 900; font-size: 24px; line-height: 1.3; }

/* ---- スマホ・タブレット（基本の形） ---- */
.play-side { display: none; }
.play-device { width: min(100% - 32px, 420px); margin-inline: auto; }
.play-stage { position: relative; background: var(--felt); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 0 var(--felt-deep); }
.play-bar { display: none; }
.play-cover { display: flex; flex-direction: column; color: var(--ivory); text-align: center; }
.play-poster { display: block; width: 100%; height: auto; aspect-ratio: 27 / 32; object-fit: cover; object-position: top; background: #e9dcc3; }
.play-icon { width: 120px; height: 120px; border-radius: 28px; margin: 32px auto 0; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); }
.play-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 20px 20px; }
.play-tag { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.6; max-width: 22em; word-break: auto-phrase; text-wrap: pretty; }
.play-cover .play-start { width: min(100%, 280px); min-height: 56px; font-size: 20px; font-weight: 900; background: var(--ivory); color: var(--ink);
  border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.play-cover .play-start:hover { background: var(--lime); }
.play-size { margin: 0; font-size: 13px; line-height: 1.7; color: rgba(251, 250, 244, .85); }
.play-size:empty { display: none; }
.play-tools { display: none; justify-content: center; }

/* 遊んでいる間（スマホ・タブレット）: 画面いっぱいの固定の重ね。iPhone の Safari は全画面の代わりにこれで遊ぶ */
.play-stage.is-on { position: fixed; inset: 0; z-index: 1000; border-radius: 0; box-shadow: none; background: #000;
  display: flex; flex-direction: column; height: 100dvh; }
.play-stage.is-on .play-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none;
  min-height: 44px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: var(--ink); color: var(--ivory); font-weight: 700; font-size: 15px; }
.play-close { width: 44px; height: 44px; font: 400 30px/1 var(--latin, sans-serif); color: var(--ivory); background: transparent; border: 0; cursor: pointer; }
.play-stage.is-on iframe { flex: 1; width: 100%; min-height: 0; border: 0; display: block; background: #000;
  padding-bottom: env(safe-area-inset-bottom); }
body.play-on { overflow: hidden; }
body.play-on .play-ad { visibility: hidden; }

/* 広告の枠（審査の前は空。場所と高さだけ取って、入っても下がずれない） */
.play-ad-sp { margin: 28px auto 0; max-width: 728px; min-height: 280px; }
.play-ad-label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }

.play-body { max-width: 640px; }
.play-app { margin-top: 36px; padding: 0; }
.play-app h2 { font-size: 22px; margin: 0 0 8px; }
.play-app p { margin: 0 0 14px; word-break: auto-phrase; text-wrap: pretty; }
.play-note { margin: 28px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--ivory); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.7; word-break: auto-phrase; text-wrap: pretty; }
.play-more { margin: 20px 0 0; font-size: 15px; }

@media (max-width: 400px) {
  .play-head h1 { font-size: 22px; }
  .play-ad-sp { min-height: 250px; }
}

/* ---- PC（1024px 以上）: スマホの枠の中で遊ぶ・左右に広告 ---- */
@media (min-width: 1024px) {
  /* 枠の中の画面の高さ。画面の高さに収め、低すぎる時は 560px で止めてページを下へ送る */
  .play { --sh: max(560px, min(100svh - 190px, 820px)); --sw: calc(var(--sh) * var(--r)); --ad: 160px; }
  .play-head { width: calc(var(--sw) + 28px); }
  .play-layout { display: flex; justify-content: center; align-items: flex-start; gap: 48px; }
  .play-side { display: block; flex: none; width: var(--ad); }
  .play-ad-side { width: var(--ad); height: 600px; margin-top: 24px; }
  .play-ad-side ins { width: var(--ad); height: 600px; }
  .play-ad-sp { display: none; }

  /* スマホの枠（平らな絵: 角丸・細い縁・影。実在の機種の形は使わない） */
  .play-device { width: auto; margin: 0; flex: none; padding: 12px; border-radius: 44px; background: var(--ink);
    border: 2px solid var(--ink); box-shadow: 0 0 0 4px var(--ivory) inset, 0 10px 0 rgba(31, 43, 69, .18), 0 24px 48px rgba(31, 43, 69, .18); }
  .play-stage, .play-stage.is-on { position: relative; inset: auto; z-index: auto; width: var(--sw); height: var(--sh);
    border-radius: 32px; box-shadow: none; display: block; }
  .play-stage.is-on .play-bar { display: none; }
  .play-stage.is-on iframe { position: absolute; inset: 0; height: 100%; padding: 0; }
  .play-stage:fullscreen { width: 100%; height: 100%; border-radius: 0; }
  .play-cover { position: absolute; inset: 0; }
  .play-cover:not(.has-poster) { justify-content: center; }
  .play-panel { flex: 1; justify-content: center; }
  body.play-on { overflow: auto; }
  body.play-on .play-ad { visibility: visible; }
  .play-tools { display: flex; }
  .play-full { margin-top: 16px; min-height: 44px; padding: 8px 18px; font: inherit; font-weight: 700; font-size: 14px;
    background: transparent; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; cursor: pointer; }
}
@media (min-width: 1280px) {
  .play { --ad: 300px; }
}
