* { box-sizing: border-box; }
html, body { margin: 0; background: #fbf4e6; color: #4a3423; }
body {
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic", "Meiryo", sans-serif;
  -webkit-text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#col { max-width: 480px; margin: 0 auto; padding: 10px 12px 40px; }
.hidden { display: none !important; }

.top { text-align: center; }
.top h1 { margin: 4px 0 0; font-size: 1.5rem; letter-spacing: 0.08em; color: #3f6b2c; }
.dayLine { margin: 2px 0 0; font-size: 0.9rem; color: #7a5a3a; }
.naeLine {
  margin: 8px 0; padding: 8px 12px; background: #fff; border: 2px solid #d9c7a8; border-radius: 14px;
  font-size: 0.95rem; text-align: center; min-height: 2.6em;
}

.hud { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 6px; }
.hud .k { font-size: 0.75rem; color: #8a6a4a; margin-right: 4px; }
.hud b { font-size: 1.4rem; }
.starNow { font-size: 1.3rem; color: #e8b730; letter-spacing: 0.1em; }
.starNow .off { color: #d9c7a8; }

#board { display: block; width: 100%; touch-action: manipulation; border-radius: 10px; cursor: pointer; }

.tools { display: flex; justify-content: center; margin: 10px 0 0; }
button {
  font: inherit; font-size: 1rem; padding: 10px 18px; border-radius: 999px; border: 2px solid #5a3d24;
  background: #fff; color: #4a3423; cursor: pointer;
}
button:active { transform: translateY(1px); }
button.sub { font-size: 0.9rem; padding: 6px 14px; border-color: #b39b7a; color: #7a5a3a; }
.how { font-size: 0.85rem; text-align: center; color: #7a5a3a; line-height: 1.6; }

.panel { margin: 14px 0; padding: 16px; background: #fff; border: 2px solid #d9c7a8; border-radius: 16px; text-align: center; }
.clear { font-size: 1.15rem; font-weight: bold; color: #3f6b2c; margin: 0 0 6px; }
.resStars { font-size: 2rem; color: #e8b730; margin: 0; letter-spacing: 0.15em; }
.resStars .off { color: #e5d8c0; }
.resText { margin: 4px 0 10px; }
.shareText { white-space: pre-wrap; font: inherit; font-size: 0.9rem; background: #f6efe0; border-radius: 10px; padding: 10px; text-align: left; margin: 0 0 10px; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.nextLine { font-size: 0.85rem; color: #8a6a4a; margin: 12px 0 0; }

.dev { margin-top: 16px; padding: 8px; font-size: 0.8rem; background: #eee; border-radius: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dev button { font-size: 0.8rem; padding: 4px 10px; }

/* 田んぼ */
.fieldBox { background: #fff; border: 2px solid #d9c7a8; border-radius: 14px; overflow: hidden; margin: 0 0 8px; }
#field { display: block; width: 100%; height: 180px; }
.fieldBar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.fieldBar .k { font-size: 0.8rem; color: #7a5a3a; white-space: nowrap; }
.fieldDots { flex: 1; font-size: 0.85rem; white-space: nowrap; }
.fieldDots .off { opacity: 0.25; }

/* お世話 */
.careBox { margin: 8px 0 12px; }
.careQ { margin: 4px 0 8px; font-weight: bold; }
.careBtns { display: flex; gap: 8px; justify-content: center; }
.careBtns button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; font-size: 1.5rem; max-width: 120px; }
.careBtns b { font-size: 1rem; }
.careBtns small { font-size: 0.7rem; color: #8a6a4a; }
.growLine { font-weight: bold; color: #3f6b2c; }
.harvestBtn { background: #e9c046; border-color: #8a6a2a; font-weight: bold; font-size: 1.1rem; padding: 12px 28px; margin: 0 0 12px; }

/* 重ねて出す画面 */
.overlay { position: fixed; inset: 0; background: rgba(60, 45, 30, 0.55); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.birthInner, .bookInner { background: #fbf4e6; border: 3px solid #5a3d24; border-radius: 20px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; padding: 18px; text-align: center; position: relative; }
.birthGlow { position: absolute; left: 50%; top: 110px; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff8d0 0%, rgba(255, 240, 160, 0.6) 40%, rgba(255, 240, 160, 0) 70%); animation: glow 1.6s ease-out forwards; pointer-events: none; }
.birthGlow.r4 { background: radial-gradient(circle, #fff3a0 0%, rgba(242, 194, 48, 0.7) 40%, rgba(242, 194, 48, 0) 70%); }
@keyframes glow { 0% { width: 10px; height: 10px; } 60% { width: 360px; height: 360px; } 100% { width: 260px; height: 260px; } }
.birthFig { position: relative; min-height: 150px; display: flex; align-items: flex-end; justify-content: center; opacity: 0; animation: pop 0.8s 0.9s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: scale(0.3) translateY(30px); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
.birthRarity { margin: 8px 0 0; color: #b08a2a; font-weight: bold; opacity: 0; animation: fade 0.5s 1.5s forwards; }
.birthName { margin: 2px 0; font-size: 1.4rem; font-weight: bold; opacity: 0; animation: fade 0.5s 1.6s forwards; }
.birthText { margin: 4px 0 14px; opacity: 0; animation: fade 0.5s 1.8s forwards; }
@keyframes fade { to { opacity: 1; } }
.shiny svg { filter: hue-rotate(160deg) saturate(1.3); }

/* 図鑑 */
.bookHead { display: flex; justify-content: space-between; align-items: center; }
.bookHead h2 { margin: 0; font-size: 1.15rem; color: #3f6b2c; }
.bookCount { margin: 6px 0 10px; font-size: 0.9rem; color: #7a5a3a; text-align: left; }
.bookGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bookGrid button { padding: 4px 2px 6px; border-radius: 12px; border: 2px solid #d9c7a8; display: flex; flex-direction: column; align-items: center; font-size: 0.65rem; line-height: 1.2; min-height: 92px; }
.bookGrid button.r2 { border-color: #9ec3e0; }
.bookGrid button.r3 { border-color: #c9a0d8; }
.bookGrid button.r4 { border-color: #e9c046; background: #fffbe8; }
.bookGrid .nm { margin-top: 2px; }
.bookDetail { margin-top: 12px; padding: 12px; background: #fff; border-radius: 14px; border: 2px solid #d9c7a8; }
.bookDetail h3 { margin: 4px 0; }
.bookDetail p { margin: 4px 0; font-size: 0.9rem; }
.hearts { color: #e2709a; letter-spacing: 0.1em; }

.top h1 .logo { display: block; width: min(78%, 330px); height: auto; margin: 0 auto; }
img.fig { display: block; }
img.fig.sil { filter: brightness(0) opacity(0.22); }
.shiny img { filter: hue-rotate(160deg) saturate(1.3); }

/* 収穫カード */
.shareInner { background: #fbf4e6; border: 3px solid #5a3d24; border-radius: 20px; width: 100%; max-width: 440px; max-height: 94vh; overflow: auto; padding: 14px; text-align: center; }
.cardImg { display: block; width: 100%; max-width: 360px; margin: 0 auto 10px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); background: #f1e8d6; aspect-ratio: 1080 / 1350; }
.shareMsg { margin: 0 0 8px; font-size: 0.9rem; min-height: 1.3em; }
.shareInner .sub { margin-top: 10px; }
.row button { font-size: 0.9rem; padding: 8px 14px; }

.naeRow { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.naeFace { width: 46px; height: auto; flex: none; }
.naeRow .naeLine { flex: 1; margin: 0; text-align: left; }
.pastBar { margin: 8px 0 0; padding: 6px 10px; background: #fff3c9; border-radius: 10px; font-size: 0.85rem; text-align: center; }

.tipLine { font-size: 0.85rem; margin: 14px 0 0; }
.tipLine a, .guide a, .foot a { color: #4f7a1f; }
.ad-slot { margin-top: 28px; min-height: 0; }
.guide { margin: 28px 0 0; font-size: 0.9rem; line-height: 1.8; }
.guide h2 { font-size: 1.05rem; color: #3f6b2c; margin: 0 0 6px; padding-left: 8px; border-left: 5px solid #a7c76b; }
.guideLinks { padding-left: 1.2em; }
.foot { text-align: center; color: #8a765c; font-size: 0.75rem; margin-top: 24px; }
.footLinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 0.8rem; }
