/* ===== 全体のデザイン ===== */
:root {
  --bg: #faf3e6;
  --board-bg: #b5a48c;
  --cell-bg: #cfc1a9;
  --text: #5c5346;
  --gap: 10px; /* マスの間隔 */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  touch-action: none; /* スマホでのスクロールを防ぐ */
  overflow: hidden;
}
header {
  width: min(92vw, 440px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
}
h1 { font-size: 24px; }
.scores { display: flex; gap: 8px; }
.score-box {
  background: var(--board-bg);
  color: #fff;
  border-radius: 8px;
  padding: 4px 12px;
  text-align: center;
  min-width: 70px;
}
.score-box .label { font-size: 11px; opacity: 0.85; }
.score-box .value { font-size: 18px; font-weight: bold; }
.sub-bar {
  width: min(92vw, 440px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}
button {
  background: #e8843c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}
button:active { transform: scale(0.96); }

/* ===== 盤面 ===== */
#board {
  position: relative;
  width: min(92vw, 440px);
  height: min(92vw, 440px);
  background: var(--board-bg);
  border-radius: 12px;
}
.cell {
  position: absolute;
  background: var(--cell-bg);
  border-radius: 8px;
}
.tile {
  position: absolute;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: left 0.12s ease, top 0.12s ease; /* スライドのアニメーション */
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.tile .emoji { line-height: 1.1; }
.tile .name { font-size: 11px; font-weight: bold; }
.tile.pop { animation: pop 0.18s ease; }
@keyframes pop {
  0% { transform: scale(0.4); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.tile.god {
  background: linear-gradient(135deg, #ffe98a, #ffb03a) !important;
  box-shadow: 0 0 18px rgba(255, 200, 60, 0.9);
}

/* ===== 勝敗のオーバーレイ ===== */
#overlay {
  position: absolute;
  inset: 0;
  background: rgba(250, 243, 230, 0.85);
  border-radius: 12px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  z-index: 10;
}
#overlay.show { display: flex; }
#overlay .msg { font-size: 26px; font-weight: bold; }
#overlay .sub { font-size: 14px; }

/* ===== ネコ図鑑 ===== */
#zukan {
  width: min(92vw, 440px);
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.zukan-item {
  background: #efe6d4;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  text-align: center;
  min-width: 34px;
}
.zukan-item.locked { filter: grayscale(1); opacity: 0.45; }
.hint { font-size: 11px; opacity: 0.7; text-align: center; margin-bottom: 10px; }
