/* ============================
   たまコミュ — スタイルシート
   ============================ */

:root {
  --pink: #ff6eb4;
  --pink-dark: #e0509a;
  --pink-light: #ffe0f0;
  --pink-pale: #fff5fa;
  --text: #3a1a2e;
  --text-muted: #b07090;
  --border: #f5c0dc;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic Pro', sans-serif;
  background: #fff5fa;
  color: var(--text);
  min-height: 100vh;
}

/* ヘッダー */
.site-header {
  background: linear-gradient(135deg, #ff6eb4 0%, #ff9ed2 100%);
  padding: 0 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(255,110,180,0.3);
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  letter-spacing: -0.5px;
}
.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-username { font-size: 13px; color: #fff; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ボタン */
.nav-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-btn.ghost { background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.6); color: #fff; }
.nav-btn.ghost:hover { background: rgba(255,255,255,0.35); }
.nav-btn.solid { background: #fff; border: none; color: var(--pink-dark); font-weight: 500; }
.nav-btn.solid:hover { background: #ffe0f0; }

/* タブナビ */
.tab-nav {
  background: #fff;
  display: flex;
  gap: 0;
  padding: 0 16px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 12px 16px;
  font-size: 13px;
  font-family: inherit;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn.active { color: var(--pink-dark); border-bottom-color: var(--pink); font-weight: 500; }
.tab-btn:hover:not(.active) { color: var(--pink); }

/* メインコンテンツ */
.main-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}
.tab-section { display: none; }
.tab-section.active { display: block; }

/* カード共通 */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}

/* 投稿フォーム */
.form-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--pink-dark);
  margin-bottom: 12px;
}
.post-form textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--pink-pale);
  resize: none;
  height: 90px;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.6;
}
.post-form textarea:focus { border-color: var(--pink); }
.post-form textarea::placeholder { color: #d0a0bc; }
.form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}
.tag-select {
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--white);
  outline: none;
  cursor: pointer;
}
.post-btn {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.post-btn:hover { opacity: 0.85; }
.post-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* タグフィルター */
.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tag-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tag-btn.active,
.tag-btn:hover { background: var(--pink); border-color: var(--pink); color: #fff; }

/* 投稿カード */
.posts-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 16px;
  transition: box-shadow 0.15s;
  animation: fadeIn 0.3s ease;
}
.post-card:hover { box-shadow: 0 4px 16px rgba(255,110,180,0.15); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.avatar-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb3d9, var(--pink));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.post-meta { flex: 1; }
.post-user { font-size: 14px; font-weight: 500; color: var(--pink-dark); }
.post-time { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.post-tag {
  background: var(--pink-light);
  color: var(--pink-dark);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.post-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 12px;
}
.post-actions { display: flex; gap: 12px; }
.action-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.action-btn:hover { border-color: var(--pink); color: var(--pink); }
.action-btn:disabled { border-color: var(--pink); color: var(--pink); }
.heart { font-size: 15px; }

/* ローディング・空 */
.loading, .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}
.loading::before { content: '🥚 '; }
.empty::before { content: '🐣 '; }

/* 認証カード */
.auth-card {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}
.auth-icon { font-size: 48px; margin-bottom: 12px; }
.auth-title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--pink-dark);
  margin-bottom: 6px;
}
.auth-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.error-msg { color: #e04060; font-size: 13px; margin-bottom: 10px; min-height: 18px; }
.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--pink-pale);
  outline: none;
  margin-bottom: 10px;
  text-align: left;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--pink); }
.auth-btn {
  width: 100%;
  border-radius: 24px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-btn.solid {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  border: none;
  color: #fff;
}
.auth-btn.solid:hover { opacity: 0.85; }
.auth-btn.google {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: #555;
}
.auth-btn.google:hover { background: var(--pink-pale); }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-switch { font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.auth-switch a { color: var(--pink); cursor: pointer; text-decoration: underline; }

/* プロフィール */
.profile-card {
  text-align: center;
  margin-bottom: 16px;
}
.profile-avatar {
  font-size: 56px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffe0f0, #ffb3d9);
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.profile-name {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--pink-dark);
  margin-bottom: 4px;
}
.profile-email { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.profile-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.badge {
  background: var(--pink-light);
  color: var(--pink-dark);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* フッター */
.site-footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .logo { font-size: 17px; }
  .tab-btn { padding: 10px 12px; font-size: 12px; }
  .card { padding: 16px; }
  .auth-card { max-width: 100%; }
}
