html, body {
  margin: 0;
  padding: 0;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body {
  zoom: 1 !important;
  transform: none !important;
}
/* =========================
   PC向け通常CSS
   ========================= */

#title {
  font-size: 26px;
  font-weight: bold;
  color: #e05a3b;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

#instruction {
  font-size: 18px;
  color: #ff7b00;
  font-weight: bold;
  margin-bottom: 12px;
  animation: blink 1.4s infinite;
}

@keyframes blink {
  0%   { opacity: 1; }
  50%  { opacity: 0.35; }
  100% { opacity: 1; }
}

#game {
  width: 480px;
  margin: 40px auto;
  padding: 16px;
  background: #fffaf3;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-align: center;
  position: relative;
}

#factory {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#tsubasa {
  width: 120px;
  height: auto;
}

#belt {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 120px;
  overflow: hidden;
  margin-top: 8px;
}

#belt-line {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(
    to right,
    #e05a3b 0%,
    #e05a3b 33%,
    #4caf50 33%,
    #4caf50 66%,
    #e05a3b 66%,
    #e05a3b 100%
  );
}

#belt-glow {
  position: absolute;
  bottom: 10px;
  left: 33%;
  width: 34%;
  height: 20px;
  border-radius: 10px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    red,
    orange,
    yellow,
    green,
    cyan,
    blue,
    violet,
    red
  );
  background-size: 400% 100%;
  mix-blend-mode: screen;
  animation: rainbowGlow 2s linear infinite;
}

@keyframes rainbowGlow {
  0%   { background-position: 0% 0%;   opacity: 0.4; }
  50%  { background-position: 100% 0%; opacity: 1;   }
  100% { background-position: 0% 0%;   opacity: 0.4; }
}

#corn {
  position: absolute;
  bottom: 30px;
  left: -100px;
  width: 80px;
}

#gauge-area {
  margin-top: 16px;
  width: 100%;
  max-width: 480px;
  height: 40px;
  position: relative;
}

#gauge {
  width: 100%;
  height: 40px;
}

#gauge-hit {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 80px;
  height: 24px;
  transform: translateX(-50%);
}


/* =========================
   📱 スマホ用追加CSS
   ========================= */
@media (max-width: 600px) {
  #top-ui {
    display: flex;
    flex-direction: column; /* ← 横並び → 縦並びに変更 */
    align-items: center;
    gap: 4px;
  }
  #score-box,
  #miss-box {
    font-size: 16px;
  }
  #message {
    white-space: normal;   /* ← 折り返しを許可 */
    width: 100%;           /* ← 横幅いっぱいに広げる */
    text-align: center;
    font-size: 14px;
    padding: 0 4px;
    box-sizing: border-box;
  }
  #game {
    width: 100%;
    max-width: 100%;
    padding: 4px;
    margin: 0 auto;
  }
/*
  #game {
    width: 100%;
    margin: 20px auto;
    padding: 12px;
  }
  #tsubasa {
    width: 32vw;
    max-width: 160px;
  }
*/
  #tsubasa {
    width: 32vw;
    max-width: 160px;
  }

  #belt,
  #gauge-area {
    width: 100%;
    max-width: 100%;
  }

  #belt-line,
  #belt-glow {
    height: 16px;
    bottom: 8px;
  }

  #corn {
    width: 18vw;
    max-width: 80px;
    bottom: 26px;
  }

  #gauge {
    height: 32px;
  }

  #gauge-hit {
    width: 20vw;
    max-width: 80px;
    height: 20px;
  }

  #title {
    font-size: 22px;
  }

  #instruction {
    font-size: 16px;
  }
}
