/* play.monoma-official.com — 暗いスレート地に、アクセントの青を 1 色だけ。光らせない・ぼかさない・グラデの玉を置かない */
:root {
  color-scheme: dark;
  --bg: #0f1318;
  --bar: #0a0d11;
  --surface: #182028;
  --line: #26303b;
  --text: #e7ecf1;
  --soft: #c9d2db;
  --muted: #8d99a6;
  --accent: #66b3ee;
  --on-accent: #0b1520;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(#141a21, var(--bg) 360px) var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ヘッダー */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; padding: 0.5rem clamp(1rem, 4vw, 2rem); padding-top: max(0.5rem, env(safe-area-inset-top)); background: var(--bar); border-bottom: 1px solid #222a33; }
.mark { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; min-height: 44px; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.mark__icon { flex: none; color: var(--accent); }
.mark__sub { color: var(--muted); font-weight: 500; }
.bar__right { display: flex; align-items: center; gap: 0.5rem; }
.bar__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.4rem; color: var(--muted); font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.bar__link:hover { color: var(--text); }
.account { position: relative; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.avatar img, .avatar span { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.avatar span { display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; }
.avatar:hover img, .avatar:hover span { box-shadow: 0 0 0 2px var(--line); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: 0.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.45); }
.menu__name { margin: 0; padding: 0.5rem 0.75rem 0.4rem; color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu a { display: flex; align-items: center; min-height: 44px; padding: 0 0.75rem; border-radius: 8px; text-decoration: none; }
.menu a:hover { background: #222b35; }

/* 小さいボタン（ログイン・編集・完了） */
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; border: 1px solid #3a4654; background: var(--surface); color: var(--text); font-size: 0.9rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease; }
.chip:hover { background: #222b35; border-color: #56677a; }
.chip:disabled { opacity: 0.4; cursor: default; }
.chip--small { min-width: 44px; padding: 0 0.8rem; font-size: 0.85rem; }

/* ホーム */
.home { flex: 1; width: min(880px, 100%); margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 3rem; padding-bottom: max(3rem, env(safe-area-inset-bottom)); }
.home__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.home h1 { margin: 0; font-size: clamp(1.6rem, 4.5vw, 2.1rem); font-weight: 700; letter-spacing: -0.01em; }
.home__foot { margin: 2.8rem 0 0; text-align: center; font-size: 0.88rem; }
.home__foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.home__foot a::after { content: "→"; margin-left: 0.35em; }
.home__foot a:hover { color: var(--text); }
.group + .group { margin-top: 1.8rem; }
.group__label { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; }

/* アイコンの並び（スマホは 4 つ、広い画面は入るだけ・中央） */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem 0.75rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, 108px); justify-content: center; gap: 1.8rem 1.5rem; } }
.app { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 100%; padding: 0; border: 0; background: none; text-decoration: none; cursor: pointer; outline: none; }
.app__icon { position: relative; display: grid; place-items: center; width: min(100%, 68px); aspect-ratio: 1; border-radius: 23%; background: var(--surface); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06) inset, 0 6px 14px rgb(0 0 0 / 0.35); transition: transform 0.45s var(--spring), box-shadow 0.2s ease; }
@supports (corner-shape: squircle) { .app__icon, .row__icon { border-radius: 32%; corner-shape: squircle; } }
@media (min-width: 640px) { .app__icon { width: 88px; } }
.app__icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.app__icon--glyph { background: var(--tile); color: rgb(255 255 255 / 0.92); font-size: clamp(1.5rem, 7vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; }
.app__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); font-size: 0.78rem; line-height: 1.3; }
@media (min-width: 640px) { .app__name { font-size: 0.85rem; } }
@media (hover: hover) { .app:hover .app__icon { transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1) inset, 0 10px 20px rgb(0 0 0 / 0.45); } .app:hover .app__name { color: var(--text); } }
.app:active .app__icon { transform: scale(0.9); transition-duration: 0.08s; }
.app:focus-visible .app__icon { outline: 3px solid var(--accent); outline-offset: 3px; }
.badge { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.7rem; font-weight: 700; box-shadow: 0 0 0 2px var(--bg); }
.badge--clear { padding: 0; width: 22px; }

/* 編集のシート */
.sheet { width: min(480px, calc(100% - 2rem)); max-height: min(80vh, 640px); padding: 1.2rem 1.2rem 1.4rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgb(0 0 0 / 0.55); }
.sheet::backdrop { background: rgb(5 8 11 / 0.7); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sheet h2 { margin: 0; font-size: 1.1rem; }
.sheet h3 { margin: 1.2rem 0 0.4rem; color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; }
.sheet__note { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.85rem; }
.rows { margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 23%; overflow: hidden; background: var(--tile, var(--bg)); font-weight: 700; }
.row__icon img { width: 100%; height: 100%; object-fit: cover; }
.row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows__empty { padding: 0.6rem 0; color: var(--muted); font-size: 0.88rem; }

/* お知らせ */
.toast { position: fixed; left: 50%; bottom: max(1.5rem, env(safe-area-inset-bottom)); z-index: 20; max-width: min(420px, calc(100% - 2rem)); padding: 0.75rem 1.1rem; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 0.88rem; box-shadow: 0 10px 30px rgb(0 0 0 / 0.5); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.35s var(--spring); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* フッター（1 行・控えめ。文字は地に 4.5:1 以上） */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 1.2rem; padding: 0.75rem clamp(1rem, 4vw, 2rem); padding-bottom: max(0.75rem, env(safe-area-inset-bottom)); border-top: 1px solid #1c232b; color: var(--muted); font-size: 0.8rem; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; }
.foot a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot small { font-size: inherit; }

/* 404 */
.page { flex: 1; width: min(720px, 100%); margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2rem) 3rem; }
.page h1 { margin: 0 0 0.4rem; font-size: clamp(1.4rem, 4vw, 1.9rem); }
.lead { margin: 0 0 1.6rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.4rem; border-radius: 999px; border: 1px solid #3a4654; font-weight: 700; text-decoration: none; transition: background-color 0.15s ease, border-color 0.15s ease; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: #8cc6f3; border-color: #8cc6f3; }
.btn--ghost { color: var(--text); }
.btn--ghost:hover { background: var(--surface); border-color: #56677a; }

@media (prefers-reduced-motion: reduce) { .app__icon, .toast, .chip, .btn { transition: none; } .app:hover .app__icon, .app:active .app__icon { transform: none; } }
