/* 3つのフロント共通のデザイントークンとレイアウト */
@import url("/shared/fonts.css");
:root {
  /* 配色は「ヤマネコとウサギ」の図に合わせる：オレンジ × クリーム × ピンク */
  --bg: #fbf3ec;
  --surface: #ffffff;
  --surface-2: #f8ece2;
  --text: #2b2420;
  --muted: #7a6b62;
  --border: #efdccd;
  --accent: #c8642a;
  --accent-text: #ffffff;
  --pink: #e8739a;
  --danger: #dc2626;
  --like: #e11d48;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 24 40 / 6%), 0 4px 16px rgb(20 24 40 / 6%);
  /* 字体はきせかえで変えられる（--typeface は shared/customize.js が入れる） */
  font-family: var(--typeface, system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1612;
    --surface: #26201b;
    --surface-2: #322a23;
    --text: #f4ebe3;
    --muted: #b5a598;
    --border: #43382f;
    --accent: #f0a26d;
    --accent-text: #1c1612;
    --pink: #f3a0bd;
    --like: #fb7185;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--accent); }
.beta { font-size: .7rem; color: #fff; background: var(--pink); padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .92rem;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.kisekae-btn { margin-left: auto; }
.me { font-size: .9rem; color: var(--muted); }

.page { max-width: 1080px; margin: 0 auto; padding: 20px 16px 64px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

.btn {
  border: none; border-radius: 999px; padding: 8px 18px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font-weight: 700;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--text); }

.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); resize: vertical;
}
.input:focus, .btn:focus-visible, .nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 700;
  background: var(--surface-2); color: var(--text); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; display: block; }
.badge {
  display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); vertical-align: middle;
}
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: .9rem; min-height: 1.4em; margin: 4px 0 0; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
/* 【仮】読み上げボタン */
.speak-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 2px 6px; border-radius: 8px; font-size: .9rem; line-height: 1.4;
}
.speak-btn:hover { background: var(--surface-2); }
.speak-btn.speaking { color: var(--accent); background: var(--surface-2); }
.avatar-btn { border: none; padding: 0; cursor: pointer; transition: transform .15s; }
.avatar-btn:hover { transform: scale(1.08); }
.avatar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar-btn.speaking { box-shadow: 0 0 0 3px var(--accent); animation: speaking-pulse 1s ease-in-out infinite; }
@keyframes speaking-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .avatar-btn.speaking { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
