
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Kaku Gothic ProN','Noto Sans JP', 'Yu Gothic', sans-serif;
  background: #f4ece4;
  color: #3a2a1a;
  margin: 0;
  padding: 10px;
  text-align: center;
}
h1 { color: #5c4033; margin: 8px 0 12px; font-size: 22px; }
#game-board {
  display: grid;
  grid-template-columns: repeat(6, 60px);
  grid-template-rows: repeat(6, 60px);
  gap: 4px;
  justify-content: center;
  margin: 10px auto 24px;
}
.tile {
  width: 60px;
  height: 60px;
  background: #fff;
  border: 2px solid #cbb7a6;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border 0.15s, box-shadow 0.15s, transform 0.05s;
  position: relative;
  overflow: hidden;
}
.tile.selected { border-color: #ff9900; box-shadow: 0 0 10px rgba(255, 153, 0, .5); transform: scale(1.03); }
.tile img { width: 48px; height: 48px; }

@keyframes sparkle {
  0% { box-shadow: 0 0 0 rgba(255,255,255,0); transform: scale(1); }
  20% { box-shadow: 0 0 14px rgba(255,255,255,0.9); transform: scale(1.05); }
  60% { box-shadow: 0 0 10px rgba(255,255,255,0.7); transform: scale(0.9); opacity: 1; }
  100% { box-shadow: 0 0 0 rgba(255,255,255,0); transform: scale(0.7); opacity: 0; }
}
.tile.matched { animation: sparkle 0.35s ease-in forwards; border-color: #ffdca8; }

.panel {
  background: #fff;
  border: 2px solid #cbb7a6;
  border-radius: 12px;
  padding: 12px;
  display: inline-block;
  margin: 8px auto;
}

#start-button, #overlay-btn, .share {
  font-size: 16px; padding: 10px 24px; margin-top: 10px;
  background: #8b5e3c; color: #fff; border: none; border-radius: 10px; cursor: pointer;
}
#start-button:hover, #overlay-btn:hover, .share:hover { background: #a87147; }

.stats {
  display: flex; gap: 12px; justify-content: center; align-items: center;
  font-weight: 600;
}

.goal { max-width: 420px; width: calc(100% - 20px); }
#goal-text { margin-bottom: 8px; font-weight: 600; }
.progress {
  width: 100%; height: 12px; background: #eee3d8; border-radius: 6px; overflow: hidden; border: 1px solid #d7c6b8;
}
#progress-bar { height: 100%; width: 0%; background: #a87147; transition: width .2s; }
.goal-numbers { margin-top: 4px; font-size: 14px; }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.dialog h2 { margin: 8px 0; }

/* Reward visual */
.reward .reward-visual {
  position: relative;
  margin: 8px auto 10px;
  width: 200px; height: 200px;
  border-radius: 16px;
  border: 2px dashed #cbb7a6;
  display: flex; align-items: center; justify-content: center;
  background: #fffaf4;
}
.reward .reward-visual img { width: 140px; height: 140px; }
.ribbon {
  position: absolute; top: 8px; left: -10px;
  background: #ff7a59; color: #fff; padding: 4px 14px; border-radius: 6px;
  transform: rotate(-10deg);
  font-weight: 700;
}

/* Share */
.share-area { margin: 8px auto; }
.share-title { margin: 6px 0; font-weight: 700; }
.share-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.share#share-x { background: #111; }
.share#share-fb { background: #1877f2; }
.share#share-line { background: #06C755; }
.copy-hint { color: #2b9348; font-size: 13px; margin-top: 6px; }

/* Simple confetti dots */
#confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  animation: fall 1.2s linear forwards;
}
@keyframes fall {
  0% { transform: translateY(-20px); opacity: 1; }
  100% { transform: translateY(220px); opacity: 0; }
}
