@charset "UTF-8";
/* ==========================================================================
   しいたけねこ間違い探し — style.css
   1. 変数・ベース      2. 背景の飾り     3. タイトル画面
   4. ゲーム画面のHUD   5. 2枚の絵        6. まる印・エフェクト
   7. 吹き出し          8. 結果画面       9. スマホ対応
   ========================================================================== */

/* ------------------------------------------------ 1. 変数・ベース */
:root {
  --cream:      #fdf8ec;
  --cream-deep: #f6ecd6;
  --beige:      #efe0c2;
  --brown:      #7c5136;
  --brown-deep: #4e3524;
  --green:      #4f7a43;
  --green-deep: #365730;
  --moss:       #8aa86a;
  --orange:     #e08b3c;
  --orange-deep:#c96f24;
  --yellow:     #f3c453;
  --line:       #e3d3b4;

  --shadow-sm: 0 2px 8px rgba(124, 81, 54, .10);
  --shadow-md: 0 8px 22px rgba(124, 81, 54, .14);
  --shadow-lg: 0 18px 44px rgba(124, 81, 54, .18);

  --radius: 22px;
  --radius-lg: 30px;
  --pill: 999px;

  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans",
          "Yu Gothic Medium", "Meiryo", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .68, .3, 1);
  --bounce: cubic-bezier(.34, 1.45, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font);
  color: var(--brown-deep);
  background:
    radial-gradient(1200px 600px at 50% -10%, #fffdf6 0%, rgba(255,253,246,0) 70%),
    linear-gradient(180deg, #fbf3e2 0%, #f4ead4 55%, #eee2c6 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; display: block; }

/* ------------------------------------------------ 2. 背景の飾り（葉っぱ） */
.forest-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.forest-deco .leaf {
  position: absolute;
  width: 26px; height: 26px;
  background: var(--orange);
  border-radius: 0 60% 0 60%;
  opacity: .16;
  animation: leafFloat 14s var(--ease) infinite;
}
.leaf1 { left: 6%;  top: 12%; }
.leaf2 { left: 88%; top: 20%; background: var(--moss); animation-delay: -3s; }
.leaf3 { left: 14%; top: 72%; background: var(--yellow); animation-delay: -6s; }
.leaf4 { left: 78%; top: 66%; animation-delay: -9s; }
.leaf5 { left: 46%; top: 6%;  background: var(--moss); animation-delay: -11s; }
.leaf6 { left: 60%; top: 88%; background: var(--yellow); animation-delay: -5s; }
@keyframes leafFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%      { transform: translate3d(14px, -22px, 0) rotate(28deg); }
}

/* ------------------------------------------------ 画面の切り替え */
.screen { display: none; position: relative; z-index: 1; }
.screen.is-active { display: block; animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ ボタン共通 */
.btn {
  font-family: inherit; font-weight: 700; cursor: pointer;
  border: none; border-radius: var(--pill);
  transition: transform .18s var(--bounce), box-shadow .18s var(--ease), background-color .18s var(--ease);
  touch-action: manipulation;
}
.btn:active { transform: translateY(2px) scale(.98); }

.btn-main {
  font-size: clamp(18px, 4.4vw, 24px);
  color: #fff;
  padding: 18px 54px;
  background: linear-gradient(180deg, #e8974a 0%, var(--orange-deep) 100%);
  box-shadow: 0 6px 0 #a95a19, var(--shadow-md);
  letter-spacing: .06em;
}
.btn-main:hover { background: linear-gradient(180deg, #eda153 0%, #d17a2a 100%); transform: translateY(-2px); }
.btn-main:active { box-shadow: 0 2px 0 #a95a19, var(--shadow-sm); }

.btn-sub {
  font-size: 16px; color: var(--brown);
  padding: 14px 32px; background: #fff;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-sub:hover { background: var(--cream); border-color: var(--orange); color: var(--orange-deep); }

.btn-ghost {
  font-size: 14px; color: #fff; padding: 11px 20px;
  background: linear-gradient(180deg, #5e8a4f 0%, var(--green-deep) 100%);
  box-shadow: 0 3px 0 #2b451f;
  white-space: nowrap;
}
.btn-ghost:hover { filter: brightness(1.07); }
.btn-ghost::before { content: "↺ "; }

.btn-sound {
  font-size: 13px; color: var(--brown);
  padding: 9px 18px; background: #fff;
  border: 2px solid var(--line); box-shadow: var(--shadow-sm);
}
.btn-sound .sound-off { display: none; }
.btn-sound[aria-pressed="false"] .sound-on { display: none; }
.btn-sound[aria-pressed="false"] .sound-off { display: inline; }

/* ------------------------------------------------ 3. タイトル画面 */
#screen-title { display: none; place-items: center; min-height: 100svh; padding: 32px 16px 48px; }
#screen-title.is-active { display: grid; }

.title-card {
  width: min(680px, 100%);
  text-align: center;
  background: rgba(255, 253, 246, .92);
  border: 3px solid #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 6vw, 44px) clamp(18px, 5vw, 44px) clamp(28px, 6vw, 40px);
}
.title-neko {
  width: clamp(120px, 30vw, 180px); margin: -14px auto 6px;
  animation: nekoBob 3.4s var(--ease) infinite;
}
@keyframes nekoBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-9px) rotate(2deg); } }

.title {
  margin: 0 0 6px; line-height: 1.25;
  font-size: clamp(28px, 7.4vw, 46px); color: var(--brown-deep);
  text-shadow: 0 2px 0 #fff, 0 4px 10px rgba(124,81,54,.15);
}
.title span { color: var(--green-deep); }
.subtitle { margin: 0 0 14px; font-size: clamp(13px, 3.4vw, 16px); color: var(--brown); }
.lead {
  margin: 0 auto 24px; max-width: 30em;
  font-size: clamp(13px, 3.3vw, 15px); line-height: 1.9; color: #6a513c;
  background: var(--cream); border-radius: var(--radius); padding: 14px 18px;
}
.howto {
  margin: 22px auto 0; padding: 0; list-style: none;
  max-width: 30em; font-size: 12.5px; line-height: 1.9; color: #7a6249; text-align: left;
}
.howto li { position: relative; padding-left: 20px; }
.howto li::before {           /* きのこのかさに見える小さな丸（絵文字は使いません） */
  content: ""; position: absolute; left: 2px; top: .62em;
  width: 10px; height: 6px; background: var(--brown);
  border-radius: 10px 10px 2px 2px;
}

/* ------------------------------------------------ 4. ゲーム画面 */
#screen-game { padding: 18px 12px 40px; max-width: 1180px; margin: 0 auto; }

.game-head { text-align: center; margin-bottom: 12px; }
.game-title {
  margin: 0; font-size: clamp(18px, 4.6vw, 28px); color: var(--brown-deep);
  text-shadow: 0 2px 0 #fff;
}
.game-title span { color: var(--green-deep); }
.game-theme {
  margin: 4px 0 0; font-size: clamp(11px, 3vw, 13px); color: var(--brown);
  letter-spacing: .04em;
}

.hud {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px;
  background: rgba(255, 253, 246, .95);
  border: 2px solid #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
}
.hud-item {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--pill);
  padding: 7px 16px;
}
.hud-item img { width: 26px; height: auto; }
.hud-label { font-size: 11.5px; color: #8a705a; font-weight: 700; letter-spacing: .04em; }
.hud-value { font-size: clamp(20px, 5vw, 26px); line-height: 1; color: var(--brown-deep); }
.hud-value small { font-size: .62em; margin: 0 2px; color: #a08a6e; }
.hud-unit { font-size: 12px; color: #8a705a; }
.hud-diff {
  font-size: 11px; color: var(--green-deep); background: #eaf2e2;
  border-radius: var(--pill); padding: 3px 9px;
}
.hud-time .hud-value { color: var(--orange-deep); font-variant-numeric: tabular-nums; }
.hud-found .hud-value { color: var(--green-deep); }
.hud-time.is-hurry { border-color: #f0b0a0; background: #fff4f0; animation: hurry 1s steps(2) infinite; }
.hud-time.is-hurry .hud-value { color: #d8452c; }
@keyframes hurry { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.timebar {
  height: 8px; margin: 10px auto 14px; max-width: 100%;
  background: #e7dbc2; border-radius: var(--pill); overflow: hidden;
}
.timebar span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  border-radius: var(--pill);
  transition: width .3s linear, background-color .3s var(--ease);
}
.timebar span.is-hurry { background: linear-gradient(90deg, #f0a07f, #d8452c); }

/* ------------------------------------------------ 5. 2枚の絵 */
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.board { position: relative; }
.board-tag {
  position: absolute; z-index: 3; top: 10px; left: 10px;
  font-size: 11.5px; font-weight: 700; color: var(--brown-deep);
  background: rgba(255, 253, 246, .93); border: 2px solid #fff;
  border-radius: var(--pill); padding: 4px 12px;
  box-shadow: var(--shadow-sm); pointer-events: none;
}
.board-inner {
  position: relative; overflow: hidden;
  border: 4px solid #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  background: var(--cream-deep);
  cursor: crosshair;
  aspect-ratio: 4 / 3;
}
.board-inner.is-shake { animation: shake .34s var(--ease); }
@keyframes shake {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); } 70% { transform: translateX(-3px); }
}
.stage-img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }

.marks, .fx { position: absolute; inset: 0; pointer-events: none; }

/* ------------------------------------------------ 6. まる印・エフェクト */
.mark {
  position: absolute; transform: translate(-50%, -50%);
  border: 4px solid var(--orange); border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 4px 14px rgba(124, 81, 54, .3);
  animation: markPop .45s var(--bounce) both;
}
.mark.is-reveal { border-color: #d8452c; border-style: dashed; animation: markPop .45s var(--bounce) both; }
@keyframes markPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(1.9); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(.92); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.spark {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  background: var(--yellow); border-radius: 0 60% 0 60%;
  animation: sparkOut .7s var(--ease) forwards;
}
.spark.leaf { background: var(--orange); }
.spark.green { background: var(--moss); }
@keyframes sparkOut {
  0%   { opacity: 1; transform: translate(0,0) scale(.4) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(200deg); }
}

.miss {
  position: absolute; transform: translate(-50%, -50%);
  width: 34px; height: 34px; color: #d8452c; font-weight: 700; font-size: 26px;
  line-height: 34px; text-align: center;
  text-shadow: 0 0 6px #fff, 0 0 6px #fff;
  animation: missOut .6s var(--ease) forwards;
}
@keyframes missOut {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1); }
}

.hint-line {
  margin: 12px 0 0; text-align: center; font-size: 12.5px; color: #7a6249; min-height: 1.6em;
}
.game-foot { margin-top: 14px; display: flex; justify-content: center; }

/* ------------------------------------------------ 7. 吹き出し */
.toast {
  position: fixed; left: 50%; top: 18%; transform: translate(-50%, 0);
  z-index: 40; pointer-events: none;
  font-weight: 700; font-size: clamp(18px, 5vw, 26px); color: #fff;
  padding: 12px 30px; border-radius: var(--pill);
  background: linear-gradient(180deg, #6da35b, #3f6b33);
  box-shadow: var(--shadow-md);
  animation: toastIn .5s var(--bounce) both;
}
.toast.is-miss { background: linear-gradient(180deg, #d9927f, #b85a44); font-size: clamp(15px, 4vw, 20px); }
@keyframes toastIn {
  0%   { opacity: 0; transform: translate(-50%, 14px) scale(.8); }
  60%  { opacity: 1; transform: translate(-50%, 0) scale(1.04); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.toast.is-out { animation: toastOut .3s var(--ease) both; }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -12px) scale(.94); } }

/* ------------------------------------------------ 8. 結果画面 */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
  background: rgba(62, 42, 28, .58);
  animation: fadeIn .3s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay[hidden] { display: none; }

.overlay-card {
  position: relative; z-index: 2;
  width: min(520px, 100%); text-align: center;
  background: var(--cream); border: 4px solid #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px clamp(18px, 5vw, 34px) 28px;
  animation: cardIn .5s var(--bounce) both;
  max-height: 88svh; overflow-y: auto;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(.94); } to { opacity: 1; transform: none; } }

.ov-neko { width: clamp(100px, 26vw, 150px); margin: -8px auto 8px; }
.overlay-card.is-all .ov-neko { width: clamp(140px, 38vw, 210px); animation: nekoBob 2.6s var(--ease) infinite; }
.ov-title {
  margin: 0 0 6px; font-size: clamp(22px, 6vw, 32px); color: var(--green-deep);
  text-shadow: 0 2px 0 #fff;
}
.overlay-card.is-over .ov-title { color: var(--orange-deep); }
.ov-text { margin: 0 0 16px; font-size: clamp(13px, 3.6vw, 16px); color: var(--brown); }
.ov-list {
  margin: 0 auto 18px; padding: 12px 16px; list-style: none; text-align: left;
  max-width: 24em; font-size: 12.5px; line-height: 1.9; color: #7a6249;
  background: #fff; border: 2px dashed var(--line); border-radius: var(--radius);
}
.ov-list:empty { display: none; }
.ov-list li { position: relative; padding-left: 18px; }
.ov-list li::before {
  content: ""; position: absolute; left: 0; top: .66em;
  width: 9px; height: 9px; border: 2px solid var(--orange); border-radius: 50%;
}
.ov-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i {
  position: absolute; top: -20px; width: 12px; height: 12px;
  border-radius: 0 60% 0 60%;
  animation: fall linear forwards;
}
@keyframes fall {
  0%   { opacity: 0; transform: translateY(-10px) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: .9; transform: translateY(105svh) rotate(540deg); }
}

/* ------------------------------------------------ 9. スマホ対応 */
@media (max-width: 860px) {
  .boards { grid-template-columns: 1fr; gap: 10px; }
  .hud { gap: 6px; padding: 8px; }
  .hud-item { padding: 6px 12px; gap: 5px; }
  .hud-item img { width: 22px; }
  .hud-label { font-size: 10.5px; }
  .hud-diff { display: none; }
  #btn-retry-top { padding: 9px 14px; font-size: 13px; }
}
@media (max-width: 420px) {
  #screen-game { padding: 14px 10px 32px; }
  .hud-level img { display: none; }
  .board-tag { font-size: 10.5px; padding: 3px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ------------------------------------------------ 公式サイトへ戻る */
.back-link {
  display: inline-block; margin-top: 18px;
  font-size: 12.5px; color: var(--brown); text-decoration: none;
  border-bottom: 2px dotted var(--line); padding-bottom: 2px;
}
.back-link:hover { color: var(--orange-deep); border-bottom-color: var(--orange); }
.game-foot { gap: 14px; align-items: center; }
