@charset "UTF-8";
/* ==========================================================================
   しいたけねこを探せ！ — game.css
   サイト本体の style.css を読み込んだうえで、このファイルを重ねています
   （色や文字は style.css のCSS変数をそのまま使っています）
   ========================================================================== */

.game-page { background: var(--color-bg); }

/* ==========================================================================
   見出し
   ========================================================================== */
.ghead {
  position: relative;
  padding: calc(var(--header-h) + 34px) 0 8px;
  text-align: center;
  background: radial-gradient(130% 78% at 50% 0%, var(--color-bg-deep) 0%, var(--color-bg-sub) 50%, var(--color-bg) 100%);
}
.ghead__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.4vw, 14px);
  font-size: clamp(26px, 6vw, 52px);
  font-weight: 700;
  color: var(--color-brown);
  letter-spacing: .02em;
  line-height: 1.3;
  text-shadow: 3px 3px 0 var(--color-white);
}
.ghead__title em { font-style: normal; color: #6d8f4e; }
.ghead__cat {
  width: clamp(44px, 8vw, 74px);
  height: auto;
  transform-origin: 50% 100%;
  animation: catBreatheTilt 9s ease-in-out infinite;
}
.ghead__lead {
  margin-top: 10px;
  font-size: clamp(13px, 1.7vw, 16px);
  color: #6b584b;
}
.ghead__lead strong { color: var(--color-brown); }

/* 木の立て札（画像は使わずCSSで） */
.ghead__sign {
  display: none;
  position: absolute;
  top: calc(var(--header-h) + 30px);
  padding: 12px 18px;
  background: #f3e3c6;
  border: 2px solid #d9bf95;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.9;
  color: #7a6144;
  box-shadow: 0 3px 0 #d9bf95;
}
.ghead__sign--l { left: 2%; transform: rotate(-3deg); }
.ghead__sign--r { right: 2%; transform: rotate(3deg); }

/* ==========================================================================
   ゲームのカード
   ========================================================================== */
.gwrap { padding: clamp(14px, 2.5vw, 26px) 0 clamp(48px, 7vw, 80px); }
.gcard {
  background: var(--color-white);
  border: 3px solid var(--color-main);
  border-radius: clamp(20px, 3vw, 30px);
  padding: clamp(12px, 2vw, 20px);
  box-shadow: var(--shadow-md);
}

/* 上のバー */
.gbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.gbar__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: var(--color-bg-sub);
  border-radius: var(--radius-pill);
}
.gbar__item--time { background: var(--color-bg-deep); }
.gbar__item--level { margin-left: auto; }
.gbar__icon { width: 30px; height: auto; }
.gbar__clock {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  border: 2.5px solid var(--color-accent);
  position: relative;
}
.gbar__clock::before,
.gbar__clock::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transform-origin: 50% 100%;
}
.gbar__clock::before { height: 6px; transform: translateX(-50%) rotate(40deg); }
.gbar__clock::after  { height: 4px; transform: translateX(-50%) rotate(-70deg); }
.gbar__body { display: grid; line-height: 1.25; }
.gbar__label { font-size: 10.5px; font-weight: 700; color: #8a7666; letter-spacing: .04em; }
.gbar__value { font-size: 15px; font-weight: 700; color: var(--color-brown); }
.gbar__value strong { font-size: 22px; color: var(--color-accent); }
.gbar__value small { font-size: 11px; margin-left: 2px; }
.gbar__actions { display: flex; gap: 8px; }

/* のこり5秒から、時間を強調する */
.gbar__item--time.is-hurry { background: #ffe0c6; animation: gHurry 1s ease-in-out infinite; }
.gbar__item--time.is-hurry .gbar__value strong { color: #d4622f; }
@keyframes gHurry {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.gtheme {
  margin: 0 0 10px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-accent);
}

/* ボタン */
.gbtn[hidden] { display: none; }   /* hidden を確実に効かせる */
.gbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  transition: transform .22s var(--ease-out), background-color .22s, box-shadow .22s, opacity .2s;
}
.gbtn small { font-size: 10.5px; opacity: .8; }
.gbtn--sub {
  background: #6d8f4e;
  color: var(--color-white);
  box-shadow: 0 4px 0 #56733c;
}
.gbtn--sub:hover { background: #7da05a; }
.gbtn--ghost {
  background: var(--color-white);
  color: var(--color-brown);
  border: 2px solid var(--color-main);
}
.gbtn--ghost:hover { background: var(--color-bg-deep); }
.gbtn--ghost:disabled { opacity: .4; pointer-events: none; }
.gbtn--main {
  min-height: 58px;
  padding: 14px 40px;
  font-size: clamp(16px, 2.2vw, 19px);
  background: var(--color-brown);
  color: var(--color-white);
  box-shadow: 0 6px 0 #5f3d28, var(--shadow-md);
}
.gbtn--main:hover { background: #8b5c3d; }
.gbtn:hover { transform: translateY(-2px); }
.gbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #5f3d28; }
.gbtn__paw {
  width: 22px;
  height: 22px;
  flex: none;
  fill: currentColor;
}

/* ==========================================================================
   森（ゲーム画面）
   ========================================================================== */
.stage {
  position: relative;
  border-radius: clamp(14px, 2vw, 22px);
  overflow: hidden;
  background: var(--color-bg-sub);
  cursor: crosshair;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.stage__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
}
.stage.is-shake { animation: gShake .3s var(--ease-out); }
@keyframes gShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* 正解の場所（見えないボタン） */
.hit {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3;
}

/* しいたけねこの居場所を知らせる輪 */
.ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(232, 168, 91, .9), 0 0 24px 6px rgba(255, 236, 170, .9);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity .3s;
}
.ring.is-on { opacity: 1; }
.ring.is-hint { opacity: 1; animation: gRing 1.4s ease-out; }
.ring.is-found { animation: gFound .7s var(--ease-bounce); }
@keyframes gRing {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(2.1); }
  35%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes gFound {
  0%   { transform: translate(-50%, -50%) scale(1); }
  40%  { transform: translate(-50%, -50%) scale(1.25); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ==========================================================================
   演出
   ========================================================================== */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }

.bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 7px 15px;
  background: var(--color-white);
  border: 2px solid var(--color-main);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-brown);
  white-space: nowrap;
  animation: gPop .95s var(--ease-out) forwards;
}
.bubble.is-good {
  background: #6d8f4e;
  border-color: #56733c;
  color: #fff;
  font-size: clamp(15px, 2.4vw, 20px);
  padding: 9px 22px;
}
@keyframes gPop {
  0%   { opacity: 0; transform: translate(-50%, -80%) scale(.7); }
  22%  { opacity: 1; transform: translate(-50%, -110%) scale(1.04); }
  70%  { opacity: 1; transform: translate(-50%, -115%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(.96); }
}

.cross {
  position: absolute;
  width: 30px; height: 30px;
  transform: translate(-50%, -50%);
  animation: gCross .65s var(--ease-out) forwards;
}
.cross::before, .cross::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 4px;
  margin: -2px 0 0 -13px;
  border-radius: 3px;
  background: #d4622f;
}
.cross::before { transform: rotate(45deg); }
.cross::after  { transform: rotate(-45deg); }
@keyframes gCross {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.spark {
  position: absolute;
  width: 11px; height: 11px;
  transform: translate(-50%, -50%);
  animation: gSpark 1.05s var(--ease-out) forwards;
}
.spark--leaf { background: #d98b3a; border-radius: 60% 0 60% 0; }
.spark--star { background: var(--color-main); clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%); }
.spark--dot  { background: #8fae63; border-radius: 50%; width: 8px; height: 8px; }
@keyframes gSpark {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(.4); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(1); }
}

.confetti {
  position: absolute;
  top: -14px;
  width: 9px; height: 13px;
  border-radius: 2px;
  animation: gFall 2.9s linear forwards;
}
.confetti--0 { background: var(--color-main); }
.confetti--1 { background: #d98b3a; border-radius: 60% 0 60% 0; }
.confetti--2 { background: #8fae63; }
.confetti--3 { background: #e8a85b; border-radius: 50%; }
@keyframes gFall {
  0%   { opacity: 0; transform: translateY(0) rotate(0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(560px) rotate(540deg); }
}

/* ==========================================================================
   かぶせる画面（タイトル・クリア・ざんねん）
   ========================================================================== */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 5;
  background: rgba(255, 253, 247, .82);
  opacity: 0;
  transition: opacity .3s var(--ease-out);
}
.overlay[hidden] { display: none; }
.overlay.is-on { opacity: 1; }
.overlay.is-final { background: rgba(255, 249, 232, .93); }

.panel {
  max-width: 460px;
  padding: clamp(16px, 3vw, 28px) clamp(18px, 3.5vw, 34px);
  background: var(--color-white);
  border: 3px solid var(--color-main);
  border-radius: clamp(18px, 2.6vw, 26px);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.panel__cat { width: clamp(72px, 13vw, 110px); height: auto; margin: 0 auto 8px; }
.panel__cat--float { animation: float 4.6s ease-in-out infinite; }
.panel__cat--hop { animation: catHopOnce .9s var(--ease-bounce); }
.panel__cat--big { width: clamp(110px, 20vw, 170px); animation: catHopOnce 1s var(--ease-bounce); }
.panel__label {
  font-size: clamp(19px, 3.2vw, 27px);
  font-weight: 700;
  color: #6d8f4e;
  letter-spacing: .03em;
}
.panel__label--sad { color: #c07a4a; }
.panel__lead {
  margin-top: 6px;
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 700;
  line-height: 1.85;
  color: var(--color-brown);
}
.panel__note {
  margin-top: 10px;
  font-size: clamp(11.5px, 1.5vw, 13px);
  line-height: 1.9;
  color: #7a6552;
}
.panel .gbtn { margin-top: 16px; }
.br-pc { display: none; }

.ghelp {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #8a7666;
}
.gback { margin-top: clamp(24px, 4vw, 38px); text-align: center; }

/* ==========================================================================
   画面の大きさ別
   ========================================================================== */
@media (max-width: 600px) {
  .gbar { gap: 6px; }
  .gbar__item { padding: 7px 11px; gap: 7px; flex: 1 1 auto; }
  .gbar__item--level { margin-left: 0; }
  .gbar__actions { width: 100%; }
  .gbar__actions .gbtn { flex: 1; }
  .gbar__icon { width: 24px; }
  .gbar__value { font-size: 13.5px; }
  .gbar__value strong { font-size: 19px; }
  /* 森は「全部が見えている」ことが大事なので、切り抜かずにそのまま出す */
  .stage__photo { aspect-ratio: 4 / 3; object-fit: contain; }
}

@media (min-width: 1100px) {
  .ghead__sign { display: block; }
}

/* ==========================================================================
   動きを減らす設定
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .ghead__cat, .panel__cat, .panel__cat--float, .panel__cat--hop, .panel__cat--big,
  .gbar__item--time.is-hurry { animation: none !important; }
  .stage.is-shake { animation: none !important; }
  .bubble, .cross { animation: gStay 1s forwards; }
  @keyframes gStay { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
}
