/* === 768px以下対応: スマホ専用演出フルセット === */
@media (max-width: 768px) {

  /* スコア表示 */
  .score-display {
    top: 3%;
    left: 25%;
    font-size: 1em;
    padding: 8px 15px;
  }

  /* ガチャボタン縦並び */
  .gacha-buttons {
    bottom: 80px;
    left: 20px;
    gap: 30px;
  }
  .gacha-buttons img {
    width: 280px;
  }

  /* 情報パネル非表示 */
  .info-panel,
  .info-panel img#charImage {
    display: none;
  }

  /* ガチャオーバーレイ（左右ズレ防止・全画面固定） */
  #gachaOverlay {
    padding: 0 !important;
    margin: 0 !important;
    position: fixed;
    inset: 0;
    width: 100vw !important;
    height: 100vh;
    display: none;
    flex-direction: column;
    z-index: 9999;
    background: rgba(0,0,0,0.65);
  }

  /* === 背景（遅延ズーム） === */
  #gachaBackground {
    position: absolute;
    inset: 0;
    z-index: 0 !important;
    filter: brightness(0.85) blur(1.5px);
    animation: bgSlow 2.6s ease-out forwards;
  }
  @keyframes bgSlow {
    0%   { transform: scale(1.1); opacity: 0.3; }
    100% { transform: scale(1.0); opacity: 1; }
  }

  /* === 光の爆発（中央固定） === */
  .lightBurst {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 120vw !important;
    height: 120vw !important;
    z-index: 3 !important;
    opacity: 0.9;
  }

  img { height: auto; }

  /* PC用の結果UIを完全無効化 */
  #singleResult,
  #multiResult {
    display: none !important;
  }

  /* =====================================
     スマホ演出の黒幕（overlay-top/bottom）
     ===================================== */

  /* 黒幕（上） */
  .overlay-top {
    height: 20vh;
    width: 100vw !important;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2em;
    font-weight: bold;
    position: relative;
    z-index: 5;
    transform: translateY(-100%);     /* 初期: 画面外（上） */
    transition: transform 0.5s cubic-bezier(.2,1,.2,1);
  }

  /* 黒幕（下） */
  .overlay-bottom {
    height: 20vh;
    width: 100vw !important;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2em;
    font-weight: bold;
    position: relative;
    z-index: 5;
    transform: translateY(100%);      /* 初期: 画面外（下） */
    transition: transform 0.5s cubic-bezier(.2,1,.2,1);
  }

  /* JSが付与：ニュッと出現 */
  .overlay-top.press-show,
  .overlay-bottom.press-show {
    transform: translateY(0);
  }

  /* =====================================
     中央60% キャラ領域（黒帯に沈ませる）
     ===================================== */
  .overlay-middle {
    height: 60vh;
    width: 100vw !important;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    overflow: visible !important;
    z-index: 5;
  }

  /* キャラ画像（黒帯に沈み + アニメ） */
  #mobileResultImage {
    max-height: 70vh;
    max-width: 100vw;
    object-fit: contain;
    position: relative;
    z-index: 10;
    margin-bottom: -12vh;

    /* アニメ初期 */
    opacity: 0;
    transform: scale(0.4);
    transition: transform 0.35s ease-out, opacity 0.35s ease-out;
  }
  /* JSが付与：キャラ出現 */
  #mobileResultImage.char-in {
    opacity: 1;
    transform: scale(1.05);
  }

  /* セリフ（キャラ重ね） */
  #mobileGreeting {
    padding: 8px 15px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 1.1em;
    position: absolute;
    bottom: 8%;
    z-index: 15;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  /* =====================================
     レアリティ スタンプ（上黒幕内）
     ===================================== */
  #mobileRarity {
    font-size: 1.4em;
    transform: translateY(-10px) scale(2);
    opacity: 0;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  }
  #mobileRarity.stamp {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  /* =====================================
     名前（右から黒帯へスライド）
     ===================================== */
     #mobileName {
       font-size: 1.4em;
       transform: translateX(150vw); /* ← 修正：絶対に見えない位置 */
       transition: transform 0.6s cubic-bezier(.3,0,.2,1);
     }

     /* スライドイン時 */
     #mobileName.name-slide {
       transform: translateX(0);
     }

  /* =====================================
     10連ガチャ演出（スマホ用）
     ===================================== */

  .ten-roll-sequence {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20;
    pointer-events: none;
  }
  .ten-roll-reel {
    position: relative;
    width: 100vw;
    transform: translateY(0);
    transition: transform 0.4s ease-out;
  }
  .ten-roll-card {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .ten-roll-card-face {
    width: 60vw;
    height: 60vw;
    max-width: 360px;
    max-height: 360px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0,0,0,0.6);
    margin-bottom: 16px;
  }
  .ten-roll-card-name { font-size: 1.4em; }
  .ten-roll-card-rarity { font-size: 1.1em; letter-spacing: 0.1em; }
  .rarity-SSR { color: #ffd700; text-shadow: 0 0 12px rgba(255,215,0,0.8); }
  .rarity-SR  { color: #a86bff; text-shadow: 0 0 10px rgba(168,107,255,0.7); }
  .rarity-R   { color: #66aaff; text-shadow: 0 0 8px rgba(102,170,255,0.6); }
  .rarity-N   { color: #cccccc; }

  .ten-roll-summary-card {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .ten-roll-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 90vw;
    max-width: 420px;
    gap: 10px;
  }
  .ten-roll-summary-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.4);
  }

  .pc-roll-sequence {
    display: none !important;
  }
  /* フラッシュ全画面 */
#flashOverlay {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  z-index: 15000;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}

/* flash 開始時 */
#flashOverlay.flash-start {
  opacity: 1; /* 真っ白 */
}

/* flash フェードアウト */
#flashOverlay.flash-fade {
  opacity: 0; /* 消える */
}
#rarityEffect {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  left: 0 !important;   /* ← 強制上書き */
  top: 0 !important;    /* ← 強制上書き */
  transform: none !important; /* PC の translate を無効化 */
  z-index: 9;
  pointer-events: none;
}
#tenRollReel {
  width: 100%;
  min-height: 100vh;               /* ← 縦スクロール防止、子が大きくてもOK */
  display: flex;
  justify-content: center;         /* 中央寄せ */
  align-items: flex-start;         /* ← ここ重要。center にすると上下が噛み合わない */
  padding-top: 30px;               /* 上に安全マージン */
  padding-bottom: 30px;            /* 下も余裕 */
  box-sizing: border-box;
  overflow-y: auto;                /* ← 必要なら縦スクロール。画面外に絶対はみ出さない */
  overflow-x: hidden;
}

/* 最終10個グリッド */
.ten-roll-summary-grid.final-grid {
  width: 92vw;                     /* スマホ幅の中に綺麗に収まる */
  max-width: 360px;               /* iPhone SE でも絶対に収まる最大幅 */
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 2列固定 */
  gap: 14px;
  padding: 14px;
  box-sizing: border-box;

  background: rgba(0,0,0,0.45);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  margin: 0 auto;                  /* 横中央寄せ */
}

/* 個別アイテム */
.ten-roll-summary-grid.final-grid img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  border: 2px solid transparent;
  padding: 4px;
  transition: transform 0.12s;
}

.ten-roll-summary-grid.final-grid img:active {
  transform: scale(0.92);
}

/* レア度色 */
.ten-roll-summary-grid.final-grid img[data-rarity="SSR"] {
  border-color: #ff4dfb;
  box-shadow: 0 0 10px #ff4dfb99;
}
.ten-roll-summary-grid.final-grid img[data-rarity="SR"] {
  border-color: gold;
  box-shadow: 0 0 10px gold;
}
.ten-roll-summary-grid.final-grid img[data-rarity="R"] {
  border-color: aqua;
}
.ten-roll-summary-grid.final-grid img[data-rarity="N"] {
  border-color: gray;
}
}
