/* =====================================================================
   Floooot° スタイル
   ・柔らかく、ゆるく、リラックスできる「大人可愛い」デザイン
   ・色の役割: パステル (主役) / 濃紺 (締め色・ロゴの外枠の色) / 白 (休ませる色)
   ・ボタンやカードは、ロゴと同じ「濃紺の線 + 外側に白ふち」のシール風
   色を変えたいときは、すぐ下の :root の数字だけを直してください。
   ===================================================================== */
:root {
  --navy: #353b64;        /* 締め色 (ロゴの外枠) */
  --ink: #3b4064;         /* 本文の文字 */
  --sub: #7a7f9e;         /* 補足の文字 */
  --white: #ffffff;

  --pink: #f7abc6;
  --pink-soft: #fbd6e3;
  --pink-deep: #f39dbc;
  --blue: #a9d4f3;
  --blue-soft: #d6ebfb;
  --blue-deep: #93c6ee;
  --lime: #cfe98f;
  --lime-soft: #ebf6cc;
  --lime-deep: #bfe070;
  --yellow: #ffe27a;
  --salmon: #f6b49a;
  --cherry: #ef6a86;      /* ♡ と大事なボタンだけ */
  --mint: #b4e3d3;
  --lavender: #c9c0f0;

  /* 壁紙の2色 (画面ごとに app.js が切り替えます) */
  --bg1: var(--pink-soft);
  --bg2: var(--pink);

  --radius: 22px;
  --sticker: 0 0 0 4px var(--white), 0 7px 0 4px rgba(53, 59, 100, .16);
  --sticker-sm: 0 0 0 3px var(--white), 0 4px 0 3px rgba(53, 59, 100, .18);
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
}
body[data-tint="blue"] { --bg1: var(--blue-soft); --bg2: var(--blue); }
body[data-tint="lime"] { --bg1: var(--lime-soft); --bg2: var(--lime); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  background: var(--bg1);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------------
   壁紙: パステル2色を大きな弧で分けて、白い水玉を散らす
   水玉のふちを少しぼかして、やわらかい滲みを出しています
   --------------------------------------------------------------------- */
.wall {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.92) 0 15%, rgba(255,255,255,.55) 19%, rgba(255,255,255,0) 25%) 0 0 / 46px 46px,
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.92) 0 15%, rgba(255,255,255,.55) 19%, rgba(255,255,255,0) 25%) 23px 23px / 46px 46px,
    radial-gradient(circle 80vw at calc(100% + 42vw) 34%, var(--bg2) 99.4%, rgba(255,255,255,0) 100%),
    var(--bg1);
  transition: background-color .5s;
}
/* 昔の印刷物のような、ほんのりざらっとした紙の風合い */
.wall::after {
  content: ""; position: absolute; inset: 0; opacity: .13; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .2  0 0 0 0 .2  0 0 0 0 .35  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* 壁紙の上に浮かぶモチーフ (星・ハート・シャボン玉・月・土星) */
.motifs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.motifs svg { position: absolute; filter: blur(.35px); opacity: .95; animation: floaty 9s ease-in-out infinite; }
.motifs svg:nth-child(2n) { animation-duration: 11s; animation-delay: -3s; }
.motifs svg:nth-child(3n) { animation-duration: 13s; animation-delay: -6s; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-10px) rotate(var(--r, 0deg)); } }
@media (prefers-reduced-motion: reduce) { .motifs svg { animation: none; } }

/* ---------------------------------------------------------------------
   ページの骨組み
   --------------------------------------------------------------------- */
.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 4px 10px;
  margin: 0 -16px; padding-left: 20px; padding-right: 20px;
  background: linear-gradient(var(--bg1) 72%, rgba(255,255,255,0));
}
.topbar .logo-s { height: 42px; width: auto; }
.topbar .back {
  border: 2.5px solid var(--navy); background: var(--white); border-radius: 999px;
  width: 40px; height: 40px; display: grid; place-items: center; box-shadow: var(--sticker-sm); cursor: pointer;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px 3px 8px;
  background: var(--white); border: 2.5px solid var(--navy); border-radius: 999px;
  font-weight: 700; font-size: 14px; box-shadow: var(--sticker-sm); white-space: nowrap;
}
.chip svg { width: 20px; height: 20px; }

h1, h2, h3 { font-weight: 900; color: var(--navy); line-height: 1.4; margin: 0 0 .5em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
.screen-title { display: flex; align-items: center; gap: 8px; margin: 6px 4px 14px; font-size: 20px; }
.screen-title svg { width: 28px; height: 28px; flex: none; }

/* カード (シール風) */
.card {
  position: relative;
  background: var(--white); border: 2.5px solid var(--navy); border-radius: var(--radius);
  padding: 16px 18px; margin: 0 0 18px; box-shadow: var(--sticker);
}
.card.soft { border-color: rgba(53, 59, 100, .55); }
.note { color: var(--sub); font-size: 13px; line-height: 1.7; }
.center { text-align: center; }
.empty { text-align: center; color: var(--sub); padding: 26px 10px; }

/* ボタン (ぷっくり + ツヤの白い点) */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 8px 22px; border-radius: 999px; cursor: pointer;
  border: 2.5px solid var(--navy); color: var(--navy); font-weight: 900; letter-spacing: .04em;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 55%), var(--c, var(--pink));
  box-shadow: var(--sticker-sm);
  transition: transform .08s, box-shadow .08s;
  text-decoration: none;
}
.btn::after { /* ツヤ */
  content: ""; position: absolute; left: 13px; top: 4px; width: 18px; height: 5px; border-radius: 5px;
  background: radial-gradient(circle, #fff 0 2px, transparent 2.4px) 0 0 / 6px 5px repeat-x; opacity: .9;
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 3px var(--white), 0 1px 0 3px rgba(53,59,100,.18); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn.block { display: flex; width: 100%; }
.btn.blue { --c: var(--blue); }
.btn.lime { --c: var(--lime); }
.btn.yellow { --c: var(--yellow); }
.btn.white { --c: var(--white); }
.btn.cherry { --c: var(--cherry); color: var(--white); }
.btn.small { min-height: 36px; padding: 4px 14px; font-size: 13px; }
.btn.small::after { display: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--sub); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* 入力欄 */
label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--navy); }
.input, select.input, textarea.input {
  width: 100%; border: 2.5px solid var(--navy); border-radius: 16px; background: #fffdfe;
  padding: 10px 14px; outline: none; font-size: 16px; /* iPhoneで拡大されない大きさ */
}
textarea.input { resize: none; line-height: 1.6; }
.input:focus { box-shadow: 0 0 0 4px var(--pink-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--cherry); flex: none; margin-top: 2px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.counter { font-size: 12px; color: var(--sub); }
.counter.over { color: var(--cherry); font-weight: 700; }
.error { color: var(--cherry); font-weight: 700; font-size: 14px; min-height: 1.4em; margin: 6px 0 0; }

/* ---------------------------------------------------------------------
   トップ (登録・ログイン)
   --------------------------------------------------------------------- */
.hero { padding: calc(36px + env(safe-area-inset-top)) 0 10px; text-align: center; }
.hero .logo { width: min(92%, 440px); margin: 0 auto 10px; filter: drop-shadow(0 8px 0 rgba(53,59,100,.12)); }
.hero .catch {
  display: inline-block; font-weight: 900; color: var(--navy); font-size: 17px; line-height: 1.8;
  background: rgba(255,255,255,.85); border-radius: 18px; padding: 8px 18px; margin: 6px 0 22px;
}
.hero-actions { display: grid; gap: 14px; max-width: 340px; margin: 0 auto 26px; }
.tabs-mini { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs-mini button {
  flex: 1; border: 2.5px solid var(--navy); background: var(--white); border-radius: 999px; padding: 6px 4px;
  font-weight: 700; cursor: pointer; font-size: 14px;
}
.tabs-mini button[aria-selected="true"] { background: var(--yellow); }
.foot-links { text-align: center; font-size: 12px; margin: 10px 0 24px; }
.foot-links a { color: var(--navy); margin: 0 6px; }
.copy { text-align: center; color: var(--sub); font-size: 11px; }

/* ---------------------------------------------------------------------
   つぶやき
   --------------------------------------------------------------------- */
.composer textarea { min-height: 76px; }
.composer .bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.post { padding: 14px 16px 12px; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.post-head .who { background: none; border: 0; padding: 0; font-weight: 900; color: var(--navy); cursor: pointer; text-align: left; font-size: 15px; }
.post-head .time { margin-left: auto; color: var(--sub); font-size: 12px; white-space: nowrap; }
.post-body { white-space: pre-wrap; word-break: break-word; font-size: 15.5px; }
.post-actions { display: flex; gap: 10px; margin-top: 10px; justify-content: flex-end; }
.act {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 14px;
  border: 2px solid var(--navy); border-radius: 999px; background: var(--white); color: var(--navy);
  font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: 0 3px 0 rgba(53,59,100,.16); text-decoration: none;
}
.act svg { width: 18px; height: 18px; }
.act.liked { background: var(--pink-soft); }
.act:active { transform: translateY(2px); box-shadow: none; }
.act[disabled] { cursor: default; }
.more { display: flex; justify-content: center; margin: 4px 0 20px; }

/* アイコン (丸) */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; overflow: hidden;
  border: 2.5px solid var(--navy); background: var(--pink-soft); display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--white);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 70%; height: 70%; }
.avatar.lg { width: 112px; height: 112px; border-width: 3px; box-shadow: 0 0 0 5px var(--white), 0 8px 0 5px rgba(53,59,100,.14); }

/* ---------------------------------------------------------------------
   メッセージ
   --------------------------------------------------------------------- */
.thread-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; padding: 12px 14px; margin-bottom: 14px; }
.thread-item .t-main { flex: 1; min-width: 0; }
.thread-item .t-name { font-weight: 900; color: var(--navy); }
.thread-item .t-last { color: var(--sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .t-time { color: var(--sub); font-size: 12px; white-space: nowrap; }

.chat { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 16px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 9px 14px; border-radius: 20px; border: 2.5px solid var(--navy);
  background: var(--white); white-space: pre-wrap; word-break: break-word; box-shadow: 0 0 0 3px var(--white);
}
.bubble-row.mine .bubble { background: var(--blue-soft); border-bottom-right-radius: 6px; }
.bubble-row:not(.mine) .bubble { background: #fff; border-bottom-left-radius: 6px; }
.bubble-time { font-size: 11px; color: var(--sub); align-self: flex-end; margin: 0 6px; white-space: nowrap; }
.bubble-img { position: relative; padding: 4px; max-width: 70%; }
.bubble-img img { border-radius: 16px; max-height: 320px; width: auto; }
.bubble-img .x {
  position: absolute; top: -10px; right: -10px; width: 36px; height: 36px; border-radius: 50%;
  border: 2.5px solid var(--navy); background: var(--white); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 3px 0 rgba(53,59,100,.2);
}
.bubble.gone { color: var(--sub); font-size: 13px; background: rgba(255,255,255,.75); border-style: dashed; }
.composer-chat {
  position: sticky; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 10;
  display: flex; gap: 8px; align-items: flex-end; padding: 10px; margin-top: 8px;
}
.composer-chat textarea { min-height: 46px; max-height: 120px; }
.icon-btn {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--navy); background: var(--white);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--sticker-sm);
}
.icon-btn[disabled] { opacity: .4; cursor: default; }
.icon-btn svg { width: 24px; height: 24px; }
.unlock { text-align: center; font-size: 12.5px; color: var(--navy); background: rgba(255,255,255,.85); border-radius: 14px; padding: 6px 10px; margin: 4px auto 0; width: fit-content; }

/* ---------------------------------------------------------------------
   記録ページ
   --------------------------------------------------------------------- */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 16px; }
.seg button {
  border: 2.5px solid var(--navy); background: var(--white); border-radius: 14px; padding: 6px 2px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; line-height: 1.35;
}
.seg button[aria-selected="true"] { background: var(--lime); box-shadow: 0 3px 0 rgba(53,59,100,.18); }
.rec { padding: 12px 16px; }
.rec .meta { font-size: 12px; color: var(--sub); display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }

/* ---------------------------------------------------------------------
   マイページ・プロフィール
   --------------------------------------------------------------------- */
.profile { text-align: center; padding-top: 26px; }
.profile .avatar.lg { margin: 0 auto 14px; }
.profile .name { font-size: 22px; font-weight: 900; color: var(--navy); margin: 0; word-break: break-all; }
.profile .tags { display: flex; justify-content: center; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.tag { border: 2px solid var(--navy); border-radius: 999px; padding: 1px 12px; font-size: 13px; font-weight: 700; background: var(--lime-soft); }
.tag.pink { background: var(--pink-soft); }
.stars { display: flex; justify-content: center; gap: 2px; margin: 8px 0 4px; flex-wrap: wrap; }
.stars svg { width: 22px; height: 22px; }
.profile-actions { display: grid; gap: 12px; margin-top: 16px; }
.danger-row { display: flex; justify-content: center; gap: 22px; margin: 4px 0 6px; }
.danger-row button { background: none; border: 0; color: var(--sub); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px; }

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li + li { border-top: 2px dashed rgba(53,59,100,.18); }
.menu-list button, .menu-list a {
  display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0;
  padding: 13px 4px; font-weight: 700; color: var(--navy); cursor: pointer; text-decoration: none; font-size: 15px;
}
.menu-list .danger { color: var(--cherry); }

/* あそびば (付属サイトの入口: 大きな惑星) */
.playground { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.planet {
  display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--navy);
  padding: 6px 4px 10px; border-radius: 20px;
}
.planet svg { width: 120px; height: 96px; transition: transform .2s; }
.planet:active svg { transform: scale(.96); }
.planet b { font-size: 16px; font-weight: 900; }
.planet small { font-size: 11.5px; color: var(--sub); line-height: 1.5; }

/* ---------------------------------------------------------------------
   下のタブ
   --------------------------------------------------------------------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(12px + env(safe-area-inset-bottom)); width: min(528px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--white); border: 2.5px solid var(--navy); border-radius: 26px; box-shadow: var(--sticker);
  padding: 6px;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 0; text-decoration: none; color: var(--navy);
  font-size: 11px; font-weight: 700; padding: 4px 0 2px; border-radius: 18px;
}
.tabbar a svg { width: 28px; height: 28px; }
.tabbar a[aria-current="page"] { background: var(--bg1); }

/* ---------------------------------------------------------------------
   お知らせ・確認の小窓
   --------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -140%);
  z-index: 60; background: var(--white); border: 2.5px solid var(--navy); border-radius: 18px; box-shadow: var(--sticker-sm);
  padding: 10px 18px; font-weight: 700; max-width: calc(100% - 32px); transition: transform .3s, visibility .3s; text-align: center;
  visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.modal-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(53,59,100,.35); display: grid; place-items: center; padding: 20px;
}
.modal { width: min(420px, 100%); max-height: 86dvh; overflow: auto; margin: 0; }
.modal .btns { display: grid; gap: 10px; margin-top: 16px; }
.radio-list { display: grid; gap: 6px; margin: 8px 0 12px; }
.radio-list label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.radio-list input { width: 20px; height: 20px; accent-color: var(--cherry); }

/* 読み込み中 */
.loading { display: flex; justify-content: center; gap: 8px; padding: 30px 0; }
.loading i { width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--navy); animation: pop 1s infinite; }
.loading i:nth-child(2) { animation-delay: .15s; }
.loading i:nth-child(3) { animation-delay: .3s; }
@keyframes pop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* 規約などの文章ページ */
.doc { padding-top: calc(20px + env(safe-area-inset-top)); }
.doc .card { line-height: 1.9; }
.doc h2 { margin-top: 1.4em; }
.doc h2:first-child { margin-top: 0; }
.doc ol, .doc ul { padding-left: 1.3em; }
.doc .logo-link img { width: 200px; margin: 0 auto 16px; }
