@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@700&display=swap");
#startBtn, #nextBattleBtn, #backToStageBtn, #endingToTitleBtn, .stage-select-btn {
  font-family: "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  font-weight: bold;
  border-radius: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  outline: none;
}

#startBtn:disabled, #nextBattleBtn:disabled, #backToStageBtn:disabled, #endingToTitleBtn:disabled, .stage-select-btn:disabled {
  background: #ccc !important;
  color: #888 !important;
  border-color: #bbb !important;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

#startBtn:hover:not(:disabled), #nextBattleBtn:hover:not(:disabled), #backToStageBtn:hover:not(:disabled), #endingToTitleBtn:hover:not(:disabled), .stage-select-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.04);
}

#endingToTitleBtn:active, .stage-select-btn:active {
  transform: scale(0.98);
}

body {
  font-family: sans-serif;
  text-align: center;
  margin: 0;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-1px);
  }
  60% {
    transform: translateX(1px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes missPop {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(10px);
  }
  80% {
    opacity: 1;
    transform: scale(1.2) translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-image: url(../../img/bg01.jpg);
  height: 100vh;
  background-size: cover;
  background-position: center;
}

.container.shake {
  animation: shake 0.18s cubic-bezier(0.36, 0.07, 0.19, 0.97) 1 both;
}

.stage-select-area {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin: 32px 0 24px 0;
}

.btn-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.btn-area .flex-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.battle-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  min-width: 220px;
  max-width: 600px;
  min-height: 40px;
  background: #232323;
  border-radius: 10px;
  border: 2.5px solid #fff;
  margin: 0 auto;
  padding: 20px 15px;
}

.battle-area #question {
  min-height: 40px;
  color: #fff;
  font-size: 24px;
  font-family: "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-shadow: 1px 1px 2px #000, 0 0 8px rgba(255, 224, 102, 0.33);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.battle-area #question .correct {
  color: blue;
}

.battle-area #question .underline {
  border-bottom: 2px solid blue;
}

.battle-area #timer {
  min-height: 40px;
  color: #6ec6ff;
  font-size: 20px;
  font-family: "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000, 0 0 8px rgba(110, 198, 255, 0.33);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.battle-area #countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 32px;
}

h1 {
  font-family: "Cinzel", "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  font-size: 2.8rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: #fffbe6;
  text-shadow: 0 2px 8px #bfa940, 0 0 2px #fff, 2px 2px 0 #bfa940, 0 0 24px #ffe06699;
  background: linear-gradient(90deg, #ffe066 0%, #ffd700 40%, #fffbe6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 18px;
  padding: 8px 0 10px 0;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.18));
}

.ending-message {
  background: rgba(35, 35, 35, 0.93);
  border: 3px solid #ffe066;
  border-radius: 16px;
  color: #fffbe6;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  padding: 32px 28px 28px 28px;
  text-align: center;
  font-family: "Cinzel", "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  font-size: 1.35rem;
  margin-bottom: 32px;
  margin-top: 18px;
  letter-spacing: 1.2px;
  line-height: 2.1;
}

.status-panels {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 20px;
}

.status-panel {
  background: #222;
  border: 3px solid #c9b87a;
  border-radius: 12px;
  color: #fff;
  min-width: 220px;
  padding: 16px 20px 12px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-family: "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
}

.status-panel.player-panel {
  border-color: #6ec6ff;
}

.status-panel.enemy-panel {
  border-color: #ff7675;
}

.status-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}

.status-hp {
  font-size: 18px;
  margin-top: 6px;
}

.status-name {
  font-size: 18px;
  margin-bottom: 4px;
  color: #ffb347;
}

.battle-log {
  background: #222;
  border: 2px solid #ffe066;
  border-radius: 10px;
  color: #fff;
  max-width: 600px;
  margin: 20px auto 10px auto;
  padding: 10px 18px;
  font-size: 18px;
  font-family: "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: left;
  white-space: pre-line;
  min-height: 10.5em;
  max-height: 10.5em;
  overflow-y: auto;
}

.battle-log .critical {
  color: red;
  font-weight: bold;
}

#startBtn {
  background: linear-gradient(90deg, #ff7675 0%, #d63031 100%);
  color: #fff;
  font-size: 22px;
  border: 2.5px solid #b71c1c;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 12px 38px;
}

#startBtn:hover:not(:disabled) {
  background: linear-gradient(90deg, #ffeaea 0%, #ff7675 100%);
  color: #b71c1c;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

#nextBattleBtn {
  background: linear-gradient(90deg, #6ec6ff 0%, #2196f3 100%);
  color: #fff;
  font-size: 20px;
  border: 2.5px solid #1976d2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 12px 34px;
  margin: 18px 0 10px 0;
}

#nextBattleBtn:hover:not(:disabled) {
  background: linear-gradient(90deg, #e3f7ff 0%, #6ec6ff 100%);
  color: #1976d2;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

#backToStageBtn {
  background: linear-gradient(90deg, #ffe066 0%, #ffd700 100%);
  color: #7c5c00;
  font-size: 16px;
  border: 2.5px solid #bfa940;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 10px 25px;
}

#backToStageBtn:hover:not(:disabled) {
  background: linear-gradient(90deg, #fffbe6 0%, #ffe066 100%);
  color: #bfa940;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

#endingToTitleBtn {
  background: linear-gradient(90deg, #ffe066 0%, #ffd700 100%);
  color: #7c5c00;
  font-family: "Cinzel", "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  font-size: 1.18rem;
  border: 2.5px solid #bfa940;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 16px 44px;
  margin-top: 18px;
}

#endingToTitleBtn:hover, #endingToTitleBtn:focus {
  background: linear-gradient(90deg, #fffbe6 0%, #ffe066 100%);
  color: #bfa940;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

#endingToTitleBtn:active {
  background: #ffd700;
  color: #bfa940;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stage-select-btn {
  background: linear-gradient(90deg, #ffe066 0%, #ffd700 100%);
  color: #7c5c00;
  font-family: "Cinzel", "serif", "游ゴシック", YuGothic, "Meiryo", sans-serif;
  font-size: 1.25rem;
  border: 2.5px solid #bfa940;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 18px 36px;
}

.stage-select-btn:hover, .stage-select-btn:focus {
  background: linear-gradient(90deg, #fffbe6 0%, #ffe066 100%);
  color: #bfa940;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.stage-select-btn:active {
  background: #ffd700;
  color: #bfa940;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.language-toggle-area {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.language-toggle {
  position: relative;
}

.language-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #e8f4fd 0%, #d1e7dd 100%);
  border: 2px solid #6c757d;
  border-radius: 25px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  overflow: hidden;
  width: 200px;
  height: 40px;
}

.language-toggle-btn:hover {
  border-color: #495057;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.language-toggle-btn[data-lang="ja"] .toggle-option[data-lang="ja"] {
  color: #fff;
  font-weight: bold;
}

.language-toggle-btn[data-lang="ja"] .toggle-option[data-lang="en"] {
  color: #6c757d;
}

.language-toggle-btn[data-lang="ja"] .toggle-slider {
  transform: translateX(0);
}

.language-toggle-btn[data-lang="en"] .toggle-option[data-lang="ja"] {
  color: #6c757d;
}

.language-toggle-btn[data-lang="en"] .toggle-option[data-lang="en"] {
  color: #fff;
  font-weight: bold;
}

.language-toggle-btn[data-lang="en"] .toggle-slider {
  transform: translateX(100%);
}

.toggle-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  height: 100%;
  font-size: 14px;
  font-weight: bold;
  color: #6c757d;
  transition: all 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
  border-radius: 21px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

#input {
  position: absolute;
  left: -9999px;
}

#inputNotice {
  color: #ff4200;
  font-weight: bold;
  margin-bottom: 10px;
}

#zenkakuWarning {
  color: red;
  font-weight: bold;
  margin-bottom: 10px;
  display: none;
}

#enemy {
  display: none;
  font-size: 24px;
  font-weight: bold;
}

.missEffect {
  position: absolute;
  z-index: 1000;
  color: #ff4444;
  font-size: 2.2rem;
  font-weight: bold;
  pointer-events: none;
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: opacity 0.4s, transform 0.4s;
  text-shadow: 0 0 8px #fff, 0 0 2px #ff4444;
  animation: missPop 0.3s ease cubic-bezier(0.7, -0.2, 0.7, 1.5);
}

.missEffect.fadeout {
  opacity: 0;
  transform: scale(1.1) translateY(-18px);
}
