/* GameBOX トップ(ゲームをえらぶ画面) */
:root {
  --bg1: #6c63ff; --bg2: #ff6fae;
  --panel: #ffffff; --ink: #2a2350; --muted: #7a7398; --line: #e3def5;
  --brand: #6c63ff; --brand-d: #5148d8;
  --glass: rgba(255,255,255,.22); --glass-line: rgba(255,255,255,.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg1: #2c2770; --bg2: #6e2a55;
    --panel: #221d3d; --ink: #eeeaff; --muted: #a9a2cc; --line: #383160;
    --glass: rgba(255,255,255,.12); --glass-line: rgba(255,255,255,.2);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg1: #2c2770; --bg2: #6e2a55;
  --panel: #221d3d; --ink: #eeeaff; --muted: #a9a2cc; --line: #383160;
  --glass: rgba(255,255,255,.12); --glass-line: rgba(255,255,255,.2);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed; background-color: var(--bg1); color: #fff;
  font-family: 'M PLUS Rounded 1c', system-ui, sans-serif; font-weight: 500; overscroll-behavior: none; }
#app { position: relative; min-height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }

/* ---------- 上: ロゴと名前 ---------- */
.head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 8px; }
.logo { width: 96px; height: 96px; border-radius: 22%; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.head h1 { margin: 2px 0 0; font-size: 26px; font-weight: 800; letter-spacing: .02em; text-shadow: 0 2px 6px rgba(0,0,0,.18); }
.who { border: 1.5px solid var(--glass-line); background: var(--glass); border-radius: 999px; padding: 5px 14px; font-size: 13.5px; font-weight: 800;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.who .pen { display: inline-block; margin-left: 4px; opacity: .85; }

/* ---------- アプリ一覧(アイコンの下に名前) ---------- */
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 8px; padding: 26px 4px 0; align-content: start; }
.app { display: flex; flex-direction: column; align-items: center; gap: 7px; color: #fff; text-decoration: none; }
.app img { width: 72px; height: 72px; border-radius: 22%; box-shadow: 0 4px 12px rgba(0,0,0,.22); transition: transform .12s; background: #fff; }
.app:active img { transform: scale(.9); }
.app span { font-size: 12.5px; font-weight: 800; text-align: center; line-height: 1.25; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
@media (min-width: 480px) { .app img { width: 80px; height: 80px; } }

.notice { margin: auto auto 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; border: 2px solid #fff;
  background: rgba(255,255,255,.95); color: #d6334a; font-size: 15px; font-weight: 800; line-height: 1.5; text-align: left; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.notice svg { width: 28px; height: 28px; flex: none; }
.notice b { text-decoration: underline; text-underline-offset: 3px; }
.ver { text-align: center; font-size: 11px; opacity: .75; padding-top: 10px; }
.notice.hidden + .ver { margin-top: auto; padding-top: 24px; }

/* ---------- 下のドック ---------- */
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); width: min(528px, calc(100% - 32px));
  display: flex; justify-content: space-around; gap: 4px; padding: 10px 8px; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.dk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; font-size: 11px; font-weight: 800; }
.dk svg { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.9); color: var(--brand); }
.dk.off svg { background: rgba(255,255,255,.25); color: #fff; }
.dk:active svg { transform: scale(.92); }
/* ホーム画面に未追加の人へ: 「ホーム追加」を指さす案内(2026-10-09ユーザー指示)。ボタンがぴかぴか光り、上で指が上下する */
#btnA2hs { position: relative; }
#btnA2hs > svg { animation: a2hsGlow 1.4s ease-in-out infinite; }
@keyframes a2hsGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,214,0,.0); } 50% { box-shadow: 0 0 0 7px rgba(255,214,0,.85); } }
.guide { position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none;
  animation: guideBob 1.1s ease-in-out infinite; font-style: normal; z-index: 2; }
.guide svg { width: 42px; height: 42px; padding: 0; background: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
@keyframes guideBob { 0%, 40%, 100% { transform: translate(-50%, -10px); } 20% { transform: translate(-50%, 6px) scale(.92); } }
.guide.done { display: none; }
@media (prefers-reduced-motion: reduce) { .guide, #btnA2hs > svg { animation: none; } }

/* ---------- ダイアログ ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(20,14,50,.5); }
.card { width: min(340px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--panel); color: var(--ink); border-radius: 24px;
  padding: 22px 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.card h2 { margin: 0 0 2px; font-size: 20px; font-weight: 800; }
.note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }
.qr { width: 200px; height: 200px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.btn { width: 100%; padding: 12px; border-radius: 14px; border: 0; background: var(--line); color: var(--ink); font-size: 15px; font-weight: 800; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 3px 0 var(--brand-d); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; }
#nameInput { width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: 18px; font-weight: 800; text-align: center; outline: none; }
#nameInput:focus { border-color: var(--brand); }
.steps { margin: 0; padding-left: 22px; font-size: 14px; line-height: 1.7; align-self: stretch; }
.steps li { margin-bottom: 4px; }

/* ---------- ホーム画面に追加の動く説明(a2hs-guide.js) ---------- */
.demo { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone { position: relative; width: 230px; height: 330px; border-radius: 26px; border: 6px solid #1b1830; background: #1b1830; overflow: hidden; flex: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); font-size: 11px; color: #222; text-align: left; }
.scr { position: absolute; inset: 0; background: #f4f2fb; border-radius: 20px; overflow: hidden; }
.scr.in .sf-menu, .scr.in .cr-menu, .scr.in .sheet, .scr.in .cr-dlg, .scr.in .add, .scr.in .home { animation: scIn .35s ease-out; }
@keyframes scIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.scr .pg { position: absolute; left: 0; right: 0; top: 0; bottom: 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 40px;
  background: linear-gradient(160deg, #6c63ff, #ff6fae); color: #fff; }
.cr-bar ~ .pg { top: 38px; bottom: 0; padding-top: 26px; }
.pg img { width: 46px; height: 46px; border-radius: 11px; }
.pg b { font-size: 12px; }
.pg .ph { width: 70%; height: 10px; border-radius: 5px; background: rgba(255,255,255,.35); }
.sf-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: #fff; border-top: 1px solid #ddd; }
.sf-bar span, .cr-bar span { flex: 1; text-align: center; background: #eee; border-radius: 10px; padding: 5px 4px; font-size: 9px; color: #555; white-space: nowrap; overflow: hidden; }
.sf-bar i, .cr-bar i { font-style: normal; font-weight: 800; font-size: 14px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cr-bar { position: absolute; left: 0; right: 0; top: 0; height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; background: #fff; border-bottom: 1px solid #ddd; }
.sf-menu, .cr-menu { position: absolute; background: #fff; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); overflow: hidden; }
.sf-menu { right: 8px; bottom: 46px; width: 150px; }
.cr-menu { right: 6px; top: 6px; width: 140px; border-radius: 6px; }
.sf-menu div, .cr-menu div { padding: 9px 12px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.sf-menu i { font-style: normal; color: #2f6fe0; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 112px; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.2); padding: 10px; }
.sh-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.sh-head img { width: 30px; height: 30px; border-radius: 7px; }
.sh-apps { display: flex; gap: 12px; padding: 10px 4px; }
.sh-apps i { width: 34px; height: 34px; border-radius: 9px; background: #e3e0ee; }
.sh-row { padding: 9px 8px; border-radius: 8px; background: #f3f3f6; margin-top: 5px; display: flex; justify-content: space-between; }
.sh-row i { font-style: normal; }
.add { position: absolute; inset: 0; background: #f2f2f7; }
.add-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 10px 10px; background: #fff; border-bottom: 1px solid #ddd; font-size: 10.5px; }
.add-top .blue { color: #2f6fe0; font-weight: 800; padding: 2px 4px; border-radius: 6px; }
.add-body { margin: 14px 10px; padding: 10px; background: #fff; border-radius: 10px; display: flex; gap: 10px; align-items: center; }
.add-body img { width: 48px; height: 48px; border-radius: 11px; }
.add-body small { display: block; color: #888; font-size: 9px; }
.dim { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.cr-dlg { position: absolute; left: 18px; right: 18px; top: 120px; background: #fff; border-radius: 14px; padding: 14px; }
.cr-dlg .row { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.cr-dlg .row img { width: 34px; height: 34px; border-radius: 8px; }
.cr-dlg .btns { display: flex; justify-content: flex-end; gap: 18px; color: #2f6fe0; font-weight: 800; }
.cr-dlg .btns span { padding: 3px 6px; border-radius: 6px; }
.home { position: absolute; inset: 0; background: linear-gradient(#1f3b73, #4a2a6b); display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; padding: 30px 14px; align-content: start; }
.home > i { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.25); justify-self: center; }
.home .new { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; font-size: 8.5px; white-space: nowrap; animation: pop .6s cubic-bezier(.3,1.6,.5,1) .3s both; }
.home .new img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 3px #ffd600; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
/* 押されたところが光る */
.hit.lit { background: #ffd600 !important; color: #2a2350 !important; box-shadow: 0 0 0 3px rgba(255,214,0,.5); transition: background .15s; }
/* 指 */
.finger { position: absolute; left: 0; top: 0; width: 34px; height: 34px; z-index: 3; transition: transform .7s cubic-bezier(.4,.1,.3,1), opacity .3s; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.finger svg { width: 34px; height: 34px; }
.finger::after { content: ''; position: absolute; left: 15px; top: 4px; width: 0; height: 0; border-radius: 50%; border: 2px solid #ffd600; transform: translate(-50%, -50%); opacity: 0; }
.finger.tap svg { animation: press .35s ease-in-out; }
.finger.tap::after { animation: ripple .6s ease-out; }
.finger.hide { opacity: 0; }
@keyframes press { 50% { transform: scale(.82) translateY(3px); } }
@keyframes ripple { from { width: 4px; height: 4px; opacity: 1; } to { width: 44px; height: 44px; opacity: 0; } }
.gsteps { margin: 0; padding: 0; list-style: none; counter-reset: s; align-self: stretch; display: flex; flex-direction: column; gap: 5px; }
.gsteps li { counter-increment: s; display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; color: var(--muted); transition: background .2s, color .2s; }
.gsteps li::before { content: counter(s); flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.gsteps li small { display: block; font-size: 11px; }
.gsteps li.on { background: #fff4b8; color: #2a2350; }
.gsteps li.on::before { background: #ffd600; color: #2a2350; }
.gsteps li.done::before { content: '✓'; background: var(--brand); color: #fff; }
@media (prefers-reduced-motion: reduce) { .finger { transition: none; } }
