/* あとりえ：毎日さわる画面は、きれいなベージュ。
   真っ白・冷たい青・グラデーション・光沢は使わない（docs/persona.md 3・4章） */

:root {
  --bg: #F5EFE6;
  --card: #FAF7F2;
  --line: #DDD3C5;
  --text: #3A3530;
  --text-soft: #6E655B;
  --accent: #A9523C;      /* くすんだ朱色 */
  --accent-text: #FAF7F2;
  --check-a: #F1EADF;     /* 透明がわかる市松模様（ベージュ2色） */
  --check-b: #E6DDCF;
  --guide: #A9523C;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.top {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 4px;
}
.top h1 { margin: 0; font-size: 1.4rem; font-weight: 600; letter-spacing: .08em; }
.sub { margin: 2px 0 0; color: var(--text-soft); font-size: .9rem; }

.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.empty { text-align: center; color: var(--text-soft); }
.empty p { margin: 4px 0; }
.small { font-size: .85rem; color: var(--text-soft); margin: 4px 0; }
.hint { text-align: center; }
.homehint { margin-top: 16px; text-align: center; }

.result h2 { margin: 0 0 12px; font-size: 1.05rem; font-weight: 600; text-align: center; }
.result .small { text-align: center; }

/* プレビュー：透明部分が見える市松模様。実寸 370×320 を超えない */
.stage {
  display: flex;
  justify-content: center;
}
.stage img {
  display: block;
  max-width: 100%;
  height: auto;
  background-color: var(--check-a);
  background-image:
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%),
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  border: 1px solid var(--line);
  /* 余白10pxのめやす：画像の内側にうっすら点線 */
  outline: 1px dashed rgba(169, 82, 60, .35);
  outline-offset: -11px;
  -webkit-touch-callout: default; /* 長押しで「写真に保存」できるように */
}

/* 下の操作ぶん。親指がとどく位置に置く */
.bar {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 100%;
}
.buttons {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
}

.btn {
  min-height: 52px;           /* 44px以上 */
  padding: 0 20px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible { outline: 3px solid rgba(169, 82, 60, .4); outline-offset: 2px; }

/* 隅っこのマスコット（右下） */
.mascot {
  position: relative;
  flex: none;
  width: 64px;
  margin-left: auto;
}
.mascot-img { display: block; width: 64px; height: 64px; }

.bubble {
  position: absolute;
  right: 4px;
  bottom: 70px;
  white-space: nowrap;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .95rem;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .6s ease, transform .6s ease;
  pointer-events: none;
}
.bubble::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: var(--card);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.bubble.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .bubble { transition: none; }
}

/* iPadなど広い画面：まん中にきれいに収める */
@media (min-width: 700px) {
  .buttons { flex-direction: row; }
  .buttons .btn { flex: 1; }
  .bar { justify-content: center; }
  .mascot { margin-left: 0; }
}
