/* ======================= 全体レイアウト ======================= */

body{
  margin:0;
  font-family:sans-serif;
  height:100vh;
  background:#f5f5f5;
  overflow:hidden;
}

#lockScreen{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:1000;
}


/* ======================= ゲーム本体 ======================= */

#game{
  display:none;
  height:100vh;
}


/* ======================= 左エリア ======================= */

#leftArea{
  width:50%;
  height:100vh;
  display:flex;
  flex-direction:column;
  border-right:1px solid #ccc;
}


/* ======================= 商品エリア ======================= */

#productArea{
  flex:1;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;        /* 表示窓はここだけ */
  position:relative;
  z-index:1;
}


/* 横スライド本体 */

#productWrapper{
  flex:1;
  min-height:0;
  min-width:0;            /* 横崩れ防止 */
  display:flex;
  width:100%;
  transition:transform 0.3s ease;
}


/* 1ページ */

.productPage{
  flex:0 0 100%;
  min-width:100%;
  height:100%;

  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(4,1fr);

  padding:10px;
  box-sizing:border-box;
  gap:10px;
}


/* ======================= 商品カード ======================= */

.product{
  height:100%;
  background:#ffffff;
  border:none;
  border-radius:10px;

  display:flex;
  flex-direction:column;
  justify-content:space-between;

  padding:8px;
  box-sizing:border-box;
  overflow:hidden;

  box-shadow:
    0 1px 2px rgba(0,0,0,0.06),
    0 4px 10px rgba(0,0,0,0.04);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.product:active{
  transform:scale(0.96);
  box-shadow:0 2px 6px rgba(0,0,0,0.15) inset;
}


/* 商品画像 */

.product img{
  width:100%;
  height:60%;
  object-fit:contain;
  object-position:center;
  background:#fff;
}


/* 商品名 */

.name{
  font-size:12px;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


/* 価格 */

.price{
  font-weight:bold;
  font-size:12px;
  text-align:center;
}


/* ======================= ページドット ======================= */

#pageDots{
  height:40px;
  display:flex;
  justify-content:center;
  align-items:center;
  flex-shrink:0;
}

.pageDot{
  font-size:20px;
  margin:0 5px;
  cursor:pointer;
  user-select:none;
}


/* ======================= カテゴリタブ ======================= */

#categoryTabs{
  display:flex;
  justify-content:space-around;
  align-items:center;
  background:#ddd;
  height:80px;
  flex-shrink:0;
  position:relative;
  z-index:10;
}

.categoryTab{
  padding:6px 12px;
  background:white;
  border-radius:4px;
  cursor:pointer;
}

.categoryTab.active{
  background:#fff;
  color:#000;
}


/* ======================= 右エリア ======================= */

#rightArea{
  width:50%;
  display:flex;
  flex-direction:column;
  background:#fff;
}

#rightTop{
  flex:1;
  border-bottom:1px solid #ccc;

  padding:0;        /* 外の余白消す */
  overflow:hidden;

  display:flex;     /* ⭐追加 */
  flex-direction:column;
}

#rightBottom{
  flex:1;
  padding:20px;
  background:#f7f7f7;
}
#checkBtn{
 width:100%;
 padding:10px;
 font-size:18px;
 margin-top:10px;
}


/* ======================= ランダム画像 ======================= */

#randomImages{
  flex:1;                 /* ⭐これが最重要 */
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;

  overflow-y:auto;        /* スクロール */

  padding:10px;           /* 内側余白 */
  box-sizing:border-box;
}

#randomImages img{
  width:100%;
  aspect-ratio:1 / 1;   /* ← 正方形固定 */
  object-fit:contain;
  background:#f8f8f8; /* 少しグレーにする */
}

#randomImages img:hover{
  transform:scale(1.05);
}

#scoreArea{
 font-size:22px;
 font-weight:bold;
 color:#333;
}

/* =======================
   モーダル（ランダム写真の部分）
======================= */
#modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.7);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:2000;
}

#modalContent{
  background:white;
  padding:20px;
  border-radius:10px;
  text-align:center;
  max-width:90%;
}

#modalImg{
  width:300px;
  max-width:100%;
  margin-bottom:10px;
}


#hintBtn{
  padding:8px 16px;
  margin-top:10px;
  cursor:pointer;
}

#modalHint{
  margin-top:10px;
  font-size:16px;
  font-weight:bold;
  display:none;   /* ← 最初は非表示 */
}

/*全問正解後のモーダル*/
#resultModal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.7);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:3000;
}

#resultContent{
  background:white;
  padding:30px;
  border-radius:10px;
  text-align:center;
}

#nextBtn{
  margin-top:20px;
  padding:10px 20px;
  font-size:18px;
  cursor:pointer;
}