/* ============================================================
   入口（index.php）：つかう画面をえらぶ
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
.home { min-height: 100vh; min-height: 100dvh; font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif; color: #2b2f45;
  background: #bfe6fb var(--bg) center / cover no-repeat fixed; -webkit-font-smoothing: antialiased; }
.home-main { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 3vh, 30px);
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }

/* ロゴ */
.home-logo { text-align: center; }
.home-logo h1 { position: relative; display: inline-block; margin: 0; font-weight: 900; font-size: clamp(64px, 9vw, 124px); line-height: 1.05; letter-spacing: .02em; color: #6b3410;
  -webkit-text-stroke: .16em #fff; paint-order: stroke fill; filter: drop-shadow(0 6px 8px rgba(80, 50, 10, .28)); animation: logo-in .7s cubic-bezier(.3, 1.5, .5, 1) both; }
.home-leaf { position: absolute; right: -.18em; top: -.28em; width: .56em; -webkit-text-stroke: 0; transform-origin: 20% 100%; animation: leaf-sway 3.5s ease-in-out infinite; }
.home-leaf svg { display: block; width: 100%; filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 2px 0 #fff) drop-shadow(-2px -2px 0 #fff); }
.home-spark { position: absolute; top: 50%; width: .5em; height: .7em; transform: translateY(-50%); }
.home-spark.l { left: -.72em; } .home-spark.r { right: -.72em; }
.home-spark i { position: absolute; width: .3em; height: .08em; border-radius: 99px; background: #ffc21a; box-shadow: 0 0 0 2px #fff; }
.home-spark.l i:nth-child(1) { right: 0; top: 0; transform: rotate(30deg); }
.home-spark.l i:nth-child(2) { right: .06em; top: .3em; }
.home-spark.l i:nth-child(3) { right: 0; top: .6em; transform: rotate(-30deg); }
.home-spark.r i:nth-child(1) { left: 0; top: 0; transform: rotate(-30deg); }
.home-spark.r i:nth-child(2) { left: .06em; top: .3em; }
.home-spark.r i:nth-child(3) { left: 0; top: .6em; transform: rotate(30deg); }
.home-spark i { animation: spark 1.8s ease-in-out infinite; }
.home-en { margin: 2px 0 0; font-weight: 900; font-size: clamp(16px, 1.8vw, 24px); letter-spacing: .22em; color: #4a2a10; text-shadow: 0 0 6px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.home-tag { position: relative; display: inline-block; margin: 8px 0 0; padding-bottom: 14px; font-weight: 800; font-size: clamp(15px, 1.6vw, 21px); letter-spacing: .06em; color: #4a2a10;
  text-shadow: 0 0 6px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.home-tag::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 6.5em; height: 5px; border-radius: 99px; background: #3d9a3a; transform: translateX(-50%); box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }

/* カード */
.home-card { width: min(560px, 100%); padding: clamp(18px, 2.6vw, 28px) clamp(16px, 2.6vw, 28px) 16px; border-radius: 30px; background: rgba(255, 252, 244, .9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .8) inset, 0 18px 40px rgba(40, 60, 30, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; gap: 14px; animation: card-in .6s .1s cubic-bezier(.3, 1.4, .5, 1) both; }
.home-card-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 4px; font-weight: 800; font-size: clamp(15px, 1.5vw, 19px); color: #3b3f55; }
.home-card-head span { color: #ffb400; font-size: 1.3em; line-height: 1; }
.home-card-head span:last-child { transform: scaleX(-1); }

.home-btn { position: relative; display: flex; align-items: center; gap: 16px; min-height: 76px; padding: 10px 16px 10px 20px; border-radius: 26px; text-decoration: none; color: #2b2f45;
  background: linear-gradient(180deg, #fff, #f6f3ec); box-shadow: 0 0 0 1px #ebe5d6 inset, 0 4px 0 #e2dccd, 0 8px 16px rgba(60, 50, 20, .1);
  transition: transform .45s cubic-bezier(.34, 1.9, .5, 1), box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.home-btn:hover { transform: translateY(-2px); }
.home-btn:active { transform: translateY(4px) scale(.97); box-shadow: 0 0 0 1px #ebe5d6 inset, 0 0 0 #e2dccd; transition-duration: .07s; }
.home-btn:focus-visible { outline: 4px solid #ffb400; outline-offset: 3px; }
.home-btn b { flex: 1; font-weight: 900; font-size: clamp(19px, 2vw, 26px); letter-spacing: .04em; }
.home-btn-ic { display: grid; place-items: center; flex: none; width: 58px; height: 48px; }
.home-btn-ic svg { width: 100%; height: 100%; }
.home-btn i { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #e6e1d4 inset; }
.home-btn i svg { width: 20px; height: 20px; fill: none; stroke: #2b2f45; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.home-btn--main { min-height: 88px; color: #fff; background: linear-gradient(180deg, #4cc265, #2a9d48 60%, #238a3d);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35) inset, 0 5px 0 #1b6e30, 0 12px 22px rgba(35, 138, 61, .35); }
.home-btn--main::before { content: ""; position: absolute; left: 14%; right: 14%; top: 5px; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .28); }
.home-btn--main:active { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35) inset, 0 0 0 #1b6e30; }
.home-btn--main b { font-size: clamp(22px, 2.4vw, 30px); text-shadow: 0 2px 0 rgba(0, 60, 20, .3); }
.home-btn--main i { background: #fff; box-shadow: none; }
.home-btn--main i svg { stroke: #238a3d; }
.home-btn--main .home-btn-ic { width: 70px; height: 54px; }

.home-who { margin: 2px 0 0; text-align: center; font-size: 12.5px; font-weight: 700; color: #7a7466; }

@keyframes logo-in { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes card-in { from { opacity: 0; transform: translateY(20px) scale(.97); } }
@keyframes leaf-sway { 50% { transform: rotate(-10deg); } }
@keyframes spark { 50% { opacity: .35; } }

@media (max-width: 600px) {
  .home { background-attachment: scroll; background-position: 30% center; }
  .home-btn { min-height: 68px; gap: 10px; padding-left: 14px; }
  .home-btn--main { min-height: 78px; }
  .home-btn-ic { width: 46px; height: 40px; }
  .home-btn--main .home-btn-ic { width: 56px; height: 44px; }
  .home-btn i { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ログイン（login.php） */
.lg-card { position: relative; }
.lg-navi { position: absolute; right: -18px; top: -86px; width: 118px; height: auto; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .25)); animation: logo-in .7s .2s cubic-bezier(.3, 1.5, .5, 1) both; pointer-events: none; }
.lg-err { margin: 0; padding: 10px 14px; border-radius: 14px; background: #fff0ea; color: #a53a12; font-weight: 800; font-size: 14px; line-height: 1.6; text-align: center; }
.lg-field { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 0 16px 0 12px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 2px #e2dccd inset, 0 4px 0 #e2dccd; cursor: text; }
.lg-field:focus-within { box-shadow: 0 0 0 3px #2a9d48 inset, 0 0 0 6px rgba(42, 157, 72, .18), 0 4px 0 #cfe6d4; }
.lg-key { flex: none; width: 46px; height: 46px; }
.lg-key svg { width: 100%; height: 100%; }
.lg-field input { flex: 1; min-width: 0; height: 60px; border: 0; outline: none; background: none; font: inherit; font-weight: 900; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: .06em; color: #2b2f45; }
.lg-field input::placeholder { color: #b8b1a2; font-weight: 800; letter-spacing: .02em; }
.lg-go { width: 100%; border: 0; font: inherit; cursor: pointer; text-align: left; }
@media (max-width: 600px) { .lg-navi { width: 84px; top: -64px; right: -6px; } }
.home-btn b small { display: block; margin-top: 2px; font-size: .58em; font-weight: 800; opacity: .85; letter-spacing: .02em; }
/* ロゴは画像（家＋わくラボ） */
.home-logo-h1 { margin: 0; line-height: 0; }
.home-logo-img { display: block; width: clamp(280px, 42vw, 580px); height: auto; margin: 0 auto; filter: drop-shadow(0 6px 10px rgba(60, 30, 5, .25)); }
.join .home-logo-img { width: clamp(220px, 60vw, 420px); }
@media (max-width: 560px) { .join .home-logo-img { width: 200px; } }
/* タキミン：さいしょの画面で ふわふわ とんでいる */
.home-takimin { position: fixed; right: clamp(10px, 8vw, 140px); top: clamp(90px, 16vh, 180px); z-index: 1; width: clamp(110px, 13vw, 200px); height: auto; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .25)); animation: tk-fly 4.5s ease-in-out infinite; cursor: pointer; }
@keyframes tk-fly { 0%, 100% { transform: translate(0, 0) rotate(-4deg); } 25% { transform: translate(-18px, -14px) rotate(3deg); } 50% { transform: translate(-6px, 6px) rotate(-2deg); } 75% { transform: translate(12px, -10px) rotate(4deg); } }
@media (max-width: 720px) { .home-takimin { width: 92px; top: 70px; right: 6px; } }
@media (prefers-reduced-motion: reduce) { .home-takimin { animation: none; } }

/* ===== スマホ：ログイン（はみ出し修正・入力欄は下に固定・背景の構図） ===== */
.home-card > * { min-width: 0; }
.lg-field input { width: 100%; }
@media (max-width: 600px) {
  .login .home-main { justify-content: flex-start; gap: 6px; padding-top: max(28px, env(safe-area-inset-top)); padding-bottom: 300px; }
  .login { background-size: auto 100%; background-position: 24% 100%; }
  .login .home-logo-img { width: min(78vw, 320px); }
  .login .home-tag { font-size: 14px; padding-bottom: 10px; }
  .login .home-takimin { top: auto; bottom: 330px; right: 8px; width: 96px; }
  .login .lg-card { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; width: auto; margin: 0; gap: 10px;
    padding: 18px 16px max(16px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
    background: rgba(255, 252, 244, .96); box-shadow: 0 -10px 30px rgba(40, 60, 30, .25); animation: lg-up .5s cubic-bezier(.3, 1.3, .5, 1) both; }
  .login .lg-card::before { content: ""; justify-self: center; width: 44px; height: 5px; margin: -6px 0 2px; border-radius: 99px; background: #e2d6bd; }
  .login .lg-navi { top: -70px; right: 14px; width: 86px; }
  .login .home-card-head { margin: 0; font-size: 15px; }
  .login .lg-field { min-height: 60px; border-radius: 18px; }
  .login .lg-field input { height: 52px; font-size: 20px; }
  .login .lg-key { width: 38px; height: 38px; }
  .login .lg-go { min-height: 64px; border-radius: 20px; }
  .login .home-who { font-size: 11.5px; line-height: 1.5; text-wrap: balance; }
  @keyframes lg-up { from { transform: translateY(100%); } }
}
@media (max-width: 600px) { .home .wk-music { top: max(10px, env(safe-area-inset-top)) !important; left: 10px !important; right: auto !important; } }
/* ロゴと言葉は たてに 中央ぞろえ（PCで ロゴと言葉が 横ならびに ずれていた 2026-09-27） */
.home-logo { display: flex; flex-direction: column; align-items: center; }
