/* ホーム画面への追加の案内（トップページ・ゲームセンター共通、2026-10-30）。
   ページの中の小さな案内 .home-app と、手順を見せるシート .ha-sheet。 */

.home-app,
.ha-sheet {
  --ha-accent: #e50012;
  --ha-on-accent: #fff;
  --ha-glow: rgba(229, 0, 18, .45);
  --ha-surface: #111725;
  --ha-surface-2: #1b2334;
  --ha-text: #f5f7fb;
  --ha-dim: #b7bdcc;
  --ha-line: rgba(255, 255, 255, .14);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ha-text);
  letter-spacing: 0;
  text-align: left;
}

.home-app--game,
.ha-sheet--game {
  --ha-accent: var(--accent, #ffe63b);
  --ha-on-accent: var(--on-neon, #0a0a10);
  --ha-glow: var(--glow, rgba(255, 230, 59, .55));
  --ha-surface: #0c0d16;
  --ha-surface-2: #181a28;
}

.home-app *,
.ha-sheet * { box-sizing: border-box; }

.home-app p,
.ha-sheet p,
.ha-sheet h2,
.ha-sheet h3,
.ha-sheet ol { margin: 0; padding: 0; }

.home-app button,
.ha-sheet button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-app :focus-visible,
.ha-sheet :focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ---------- ページの中の案内 ---------- */

.home-app {
  position: relative;
  padding: 14px;
  background: #06090f;
}

.home-app--game {
  z-index: 1;
  padding: 16px 14px 0;
  background: transparent;
}

.home-app__card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 14px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 42px 14px 14px;
  border-radius: 18px;
  background: var(--ha-surface);
  box-shadow: 0 0 0 1px var(--ha-line), 0 10px 26px rgba(0, 0, 0, .35);
}

.home-app--game .home-app__card {
  background: rgba(12, 13, 22, .94);
  box-shadow: 0 0 0 3px var(--outline, #0a0a10), 0 0 0 5px var(--ha-accent), 0 0 24px var(--ha-glow);
}

.home-app__icon {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: none;
}

.home-app__icon img,
.home-app__icon-image {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 15px;
}

/* インストールできるときは、アイコンを押せることを光の輪で伝える */
.home-app__icon.is-install::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--ha-accent);
  border-radius: 19px;
  animation: ha-pulse 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes ha-pulse {
  0% { transform: scale(.94); opacity: 1; }
  100% { transform: scale(1.18); opacity: 0; }
}

.home-app__title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  text-wrap: balance;
}

.home-app .home-app__lead {
  margin-top: 2px;
  color: var(--ha-dim);
  font-size: 12.5px;
  text-wrap: balance;
}

.home-app__actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: -28px;
}

.home-app .home-app__cta {
  flex: 1;
  min-height: 46px;
  padding: 8px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ha-accent);
  color: var(--ha-on-accent);
  font-size: 15px;
  font-weight: 800;
}

.home-app--game .home-app__cta {
  box-shadow: 0 0 0 3px var(--outline, #0a0a10), 0 0 18px var(--ha-glow);
  transform: skewX(-8deg);
}
.home-app--game .home-app__cta > span { display: inline-block; transform: skewX(8deg); }

.home-app .home-app__how {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ha-dim);
  font-size: 13px;
  text-decoration: underline;
  white-space: nowrap;
}

.home-app .home-app__close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ha-dim);
  font-size: 20px;
  line-height: 1;
}

/* ---------- シート ---------- */

html.ha-lock,
html.ha-lock body { overflow: hidden; }

.ha-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10000;
  width: 100%;
  max-width: 520px;
  height: auto;
  max-height: 92vh;
  max-height: 92dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--ha-surface);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.ha-sheet[open] { display: block; }

.ha-sheet::backdrop { background: rgba(3, 5, 10, .74); }

.ha-sheet__inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.ha-sheet__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 6px 8px 0 8px;
}

.ha-sheet .ha-sheet__back,
.ha-sheet .ha-sheet__close {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: none;
}

.ha-sheet .ha-sheet__back {
  padding: 0 10px;
  color: var(--ha-dim);
  font-size: 15px;
  font-weight: 700;
}
.ha-sheet .ha-sheet__back span { font-size: 20px; }

.ha-sheet .ha-sheet__close {
  margin-left: auto;
  color: var(--ha-text);
  font-size: 24px;
  line-height: 1;
}

.ha-sheet__body {
  flex: 1;
  min-height: 0;
  padding: 0 18px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ha-sheet .ha-title {
  color: var(--ha-text);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.35;
}

/* 画面が切り替わったときに読み上げのためフォーカスを移すだけなので、枠は出さない */
.ha-sheet .ha-title:focus,
.ha-sheet .ha-title:focus-visible { outline: none; }

.ha-sheet .ha-subtitle {
  margin-top: 26px;
  color: var(--ha-text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.ha-sheet .ha-lead {
  margin-top: 8px;
  color: var(--ha-dim);
  font-size: 14px;
}

.ha-sheet .ha-note {
  margin-top: 14px;
  color: var(--ha-dim);
  font-size: 12.5px;
}

.ha-sheet .ha-warning {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 176, 32, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 176, 32, .55);
  color: #ffe2a8;
  font-size: 13.5px;
}

.ha-text-button {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ha-text);
  font-weight: 800;
  text-decoration: underline;
}

.ha-glyph {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ブラウザーを選ぶ */
.ha-choices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.ha-choice {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  border: 0;
  border-radius: 16px;
  background: var(--ha-surface-2);
  box-shadow: inset 0 0 0 1px var(--ha-line);
  text-align: left;
}

.ha-choice img {
  display: block;
  width: 56px;
  height: 56px;
}

.ha-choice__text b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.ha-choice__text small {
  display: block;
  margin-top: 1px;
  color: var(--ha-dim);
  font-size: 12px;
  line-height: 1.45;
}

.ha-choice__go {
  color: var(--ha-dim);
  font-size: 24px;
  line-height: 1;
}

.ha-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--ha-accent);
  color: var(--ha-on-accent);
  font-size: 11.5px;
  font-weight: 800;
}

/* Safari の画面の切り替え */
.ha-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 14px;
  background: var(--ha-surface-2);
}

.ha-switch button {
  min-height: 44px;
  padding: 4px 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ha-dim);
  font-size: 13.5px;
  font-weight: 700;
}

.ha-switch button[aria-pressed="true"] {
  background: var(--ha-accent);
  color: var(--ha-on-accent);
}

/* 手順 */
.ha-sheet .ha-steps {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  list-style: none;
}

.ha-step { margin: 0; padding: 0; }

.ha-step__text {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  color: var(--ha-text);
  font-size: 15px;
  font-weight: 700;
}

.ha-step__text small {
  display: block;
  margin-top: 2px;
  color: var(--ha-dim);
  font-size: 12.5px;
  font-weight: 500;
}

.ha-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ha-accent);
  color: var(--ha-on-accent);
  font-size: 14px;
  font-weight: 900;
}

.ha-step__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 6 / 5;
  margin-top: 9px;
  border-radius: 14px;
  background: #0b0f18;
  box-shadow: 0 0 0 1px var(--ha-line);
}

/* ボタン */
.ha-sheet .ha-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  padding: 10px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--ha-accent);
  color: var(--ha-on-accent);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.ha-sheet .ha-status {
  margin-top: 10px;
  color: #ffe2a8;
  font-size: 13.5px;
  font-weight: 700;
}

.ha-sheet .ha-install {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 18px 12px;
  border: 0;
  border-radius: 18px;
  background: var(--ha-surface-2);
  box-shadow: inset 0 0 0 2px var(--ha-accent), 0 0 22px var(--ha-glow);
  font-size: 16px;
  font-weight: 800;
}

.ha-sheet .ha-install img {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 50%;
}

.ha-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 8px 8px 12px;
  border-radius: 12px;
  background: var(--ha-surface-2);
}

.ha-copy__url {
  overflow-wrap: anywhere;
  color: var(--ha-text);
  font-size: 12.5px;
  line-height: 1.4;
  -webkit-user-select: all;
  user-select: all;
}

.ha-sheet .ha-copy__button {
  min-height: 44px;
  padding: 4px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--ha-accent);
  color: var(--ha-on-accent);
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}

.ha-copy__area {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  font-size: 16px;
}

/* タブレットの広い画面では中央に出し、手順を2列に並べる */
@media (min-width: 700px) {
  .ha-sheet {
    inset: 0;
    max-width: 680px;
    height: fit-content;
    margin: auto;
    border-radius: 22px;
  }
  .ha-steps { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .home-app__icon.is-install::after { animation: none; transform: none; }
}
