@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@500;700;900&family=Mochiy+Pop+One&family=DotGothic16&display=swap');

/* ============================================================
   tanaka-kids — 子ども向け（大きく・丸く・たのしく）
   テーマ: theme-kei（マインクラフト/ドット） / theme-ritsu（パンダ/まる）
   ============================================================ */

:root {
  --bg: #eef5e6;
  --surface: #ffffff;
  --ink: #2f2a24;
  --ink-soft: #6f6a60;
  --line: #d9e2cf;
  --accent: #5db04f;       /* デフォルトは草グリーン */
  --accent-dark: #3e8e41;
  --radius: 22px;
  --maxw: 720px;
  font-family: "Zen Maru Gothic", -apple-system, "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); line-height: 1.8; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding-bottom: 40px; }
a { color: var(--accent-dark); }

.k-header { padding: 22px 18px 16px; padding-top: calc(22px + env(safe-area-inset-top, 0px)); text-align: center; color: #fff; background: var(--accent); }
.k-header .hi { font-size: 13px; opacity: .9; margin: 0; }
.k-header h1 { margin: 4px 0 0; font-size: 30px; }
.k-header .tag { display: inline-block; margin-top: 8px; font-size: 12px; background: rgba(255,255,255,.25); border-radius: 999px; padding: 4px 14px; }

main { max-width: var(--maxw); margin: 0 auto; padding: 18px 16px 8px; }

.k-card {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; margin-bottom: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.05);
}
.k-card h2 { margin: 0 0 8px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.k-card p { color: var(--ink-soft); margin: 6px 0; }
.k-soon { opacity: .7; }
.k-soon .pill { font-size: 12px; background: #fff3e0; color: #c8772e; border-radius: 999px; padding: 2px 10px; }

/* 大きなボタン（子どもの指でも押しやすい） */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 15px 26px; font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 4px 0 var(--accent-dark); width: 100%;
}
.k-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-dark); }
.k-btn.sub { background: #fff; color: var(--accent-dark); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }

.k-field { width: 100%; box-sizing: border-box; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 16px; font-family: inherit; margin-bottom: 10px; }
textarea.k-field { min-height: 110px; resize: vertical; }
.k-label { font-size: 13px; color: var(--ink-soft); margin: 2px 2px 4px; font-weight: 700; }
.k-status { font-size: 13px; color: var(--accent-dark); min-height: 1em; }
.k-status.err { color: #c0392b; }

/* メニュータイル */
.k-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.k-tile {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--ink); text-align: center; box-shadow: 0 4px 0 rgba(0,0,0,.05);
  font-weight: 700;
}
.k-tile:active { transform: translateY(2px); }
.k-tile .ico { font-size: 38px; display: block; }

/* 編集バー */
.edit-bar { position: sticky; top: 0; z-index: 30; background: #fffbe7; border-bottom: 2px solid #f0e3a8; padding: 8px 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.edit-bar .on { color: #2e7d32; font-weight: 700; }
.edit-bar button { font-family: inherit; }

.back { display: inline-block; margin: 6px 2px 0; color: var(--ink-soft); text-decoration: none; font-size: 14px; }

/* ── テーマ: 啓（マインクラフト／ドット） ───────────────── */
body.theme-kei { --bg: #e7f0dd; --accent: #5db04f; --accent-dark: #3e7d2f; --line: #cdd9bf; }
body.theme-kei .k-header { background: linear-gradient(180deg, #6cc04f, #4f9b3a); border-bottom: 6px solid #6b4a2b; }
body.theme-kei h1, body.theme-kei .k-card h2 { font-family: "DotGothic16", "Zen Maru Gothic", monospace; }
body.theme-kei .k-card { border-radius: 8px; border-color: #c7d4ba; box-shadow: 4px 4px 0 rgba(107,74,43,.12); }
body.theme-kei .k-tile { border-radius: 8px; }
body.theme-kei .k-btn { border-radius: 8px; }
body.theme-kei .k-field { border-radius: 8px; }

/* ── テーマ: りつ（パンダ／まる） ───────────────────────── */
body.theme-ritsu { --bg: #f1f4ee; --accent: #7bc043; --accent-dark: #5a9e2e; --line: #e0e0e0; }
body.theme-ritsu .k-header { background: #3a3a3a; border-bottom: 6px solid #7bc043; }
body.theme-ritsu h1, body.theme-ritsu .k-header h1 { font-family: "Mochiy Pop One", "Zen Maru Gothic", sans-serif; }
body.theme-ritsu .k-card { border-radius: 28px; }
body.theme-ritsu .k-card h2 { font-family: "Mochiy Pop One", "Zen Maru Gothic", sans-serif; }
body.theme-ritsu .k-btn { border-radius: 999px; }
body.theme-ritsu .k-tile { border-radius: 28px; }
/* りつは小2＝文字大きめ */
body.theme-ritsu { font-size: 17px; }
body.theme-ritsu .k-card h2 { font-size: 22px; }

/* ── 中身パーツ ──────────────────────────────────────────── */
.mini, .mini-del { font-family: inherit; border: none; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.mini { background: var(--surface); border: 2px solid var(--line); color: var(--ink); }
.mini-del { background: #fdeaea; color: #c0392b; margin-left: 6px; }

/* 作品ギャラリー */
.art-upload { margin-bottom: 12px; }
.art-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.art-item { margin: 0; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.art-item img { display: block; width: 100%; height: 150px; object-fit: cover; }
.art-item figcaption { padding: 6px 10px; font-size: 13px; }
.art-item .mini-del { display: block; width: 100%; border-radius: 0; margin: 0; }

/* 記録＋ごほうび */
.reward { text-align: center; padding: 10px 0 4px; }
.reward-num { font-size: 22px; font-weight: 700; }
.badges { margin-top: 6px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.kbadge { background: #fff6df; border: 2px solid #f0d98a; border-radius: 999px; padding: 2px 12px; font-weight: 700; }
.rec-add { margin: 10px 0; }
.rec-list { margin-top: 8px; }
.rec-item { display: flex; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.rec-item:last-child { border-bottom: none; }
.rec-tag { font-size: 12px; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 1px 9px; flex: 0 0 auto; }
.rec-title { flex: 1 1 auto; word-break: break-word; }

/* 日記・本 */
.post-item { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.post-title { font-weight: 700; font-size: 17px; }
.post-meta { font-size: 12px; color: var(--ink-soft); }
.post-body { white-space: pre-wrap; word-break: break-word; margin-top: 6px; line-height: 1.9; }
.post-actions { margin-top: 8px; }

/* 名言ポップアップ（投資Library風） */
.quote-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.quote-pop { background: var(--surface); border-radius: 22px; padding: 28px 22px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.quote-mark { font-size: 40px; color: var(--accent); line-height: 1; }
.quote-text { font-size: 20px; font-weight: 700; line-height: 1.9; margin: 8px 0; word-break: break-word; }
.quote-by { color: var(--ink-soft); margin-bottom: 16px; }
