:root {
  --cream: #FBF6EE;
  --pink: #B98884;
  --pink-deep: #A06E6A;
  --ink: #4A3F38;
  --sage: #A8BBA0;
  --white: #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.9;
}

/* ---------- ゲーム画面 ---------- */
#game-area {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, #F3EBDD 0%, var(--cream) 60%);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}

#score-label, #next-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--pink-deep);
}

#score {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
}

#best { font-size: 13px; font-weight: 700; opacity: .65; }

.hud-right { text-align: center; }

#next-img:not([src]) { visibility: hidden; }

#next-img {
  width: 52px; height: 52px;
  object-fit: contain;
  background: var(--white);
  border-radius: 14px;
  border: 2px solid #EADFD0;
  padding: 5px;
}

#rotate-btn {
  position: absolute;
  right: 18px;
  bottom: max(84px, calc(64px + env(safe-area-inset-bottom)));
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--pink);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(160, 110, 106, .35);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
#rotate-btn:active { transform: scale(.92); }

#hint {
  position: absolute;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--pink-deep);
  opacity: .8;
  pointer-events: none;
}

#scroll-cue {
  position: absolute;
  left: 16px;
  bottom: max(72px, calc(52px + env(safe-area-inset-bottom)));
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid #EADFD0;
  color: var(--pink-deep);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- オーバーレイ ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(74, 63, 56, .35);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  padding: 24px;
}
.overlay[hidden] { display: none; }

.overlay-card {
  background: var(--white);
  border-radius: 24px;
  padding: 30px 26px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(74, 63, 56, .2);
}

.overlay-chara { width: 84px; height: 84px; object-fit: contain; }

.overlay-card h1 {
  font-size: 26px; font-weight: 800; line-height: 1.4;
  color: var(--pink-deep); margin: 10px 0;
}
.overlay-card h2 {
  font-size: 21px; font-weight: 800;
  color: var(--pink-deep); margin: 8px 0;
}
.overlay-card p { font-size: 14px; margin-bottom: 16px; }

#result-score { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
#result-score strong { font-size: 34px; color: var(--pink-deep); }
#result-best { font-size: 13px; opacity: .7; margin-bottom: 16px; }

.ped-select { margin: 2px 0 16px; }
.ped-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--pink-deep);
  margin-bottom: 7px;
}
.ped-btns { display: flex; gap: 6px; justify-content: center; }
.ped-btns button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 999px;
  border: 2px solid var(--pink);
  background: var(--white);
  color: var(--pink-deep);
  cursor: pointer;
}
.ped-btns button.on {
  background: var(--pink);
  color: var(--white);
}

.main-btn {
  display: inline-block;
  border: none;
  background: var(--pink);
  color: var(--white);
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  padding: 13px 40px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(160, 110, 106, .3);
}
.main-btn:active { transform: scale(.96); }
.main-btn.wide { width: 100%; padding: 15px 20px; }

.sub-btn {
  display: block;
  margin: 12px auto 0;
  border: 2px solid var(--pink);
  background: var(--white);
  color: var(--pink-deep);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 24px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- LP ---------- */
#lp {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.lp-section { padding: 28px 0; text-align: center; }

.lp-section h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--pink-deep);
  margin-bottom: 18px;
}

.lp-section p { font-size: 14.5px; margin-bottom: 14px; }

#chara-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
#chara-strip img {
  width: 56px; height: 56px;
  object-fit: contain;
  background: var(--white);
  border-radius: 14px;
  border: 2px solid #EADFD0;
  padding: 5px;
}

.link-list { display: flex; flex-direction: column; gap: 12px; }

.link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 2px solid #EADFD0;
  border-radius: 16px;
  padding: 14px 18px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 700;
}
.link-btn svg { color: var(--pink); flex-shrink: 0; }
.link-btn:active { background: #FDF9F2; }

footer {
  border-top: 2px solid #EADFD0;
  padding: 26px 0 10px;
  text-align: center;
  font-size: 12.5px;
  opacity: .8;
}
footer a { color: var(--pink-deep); }