* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #f2f4f7;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Yu Gothic", "Noto Sans JP", sans-serif;
  background: linear-gradient(180deg, #eaf3ff 0%, #f6f8fb 55%, #eef1f5 100%);
  color: #263238;
  -webkit-tap-highlight-color: transparent;
}

#app {
  width: min(92%, 700px);
  margin: 24px auto;
  padding: 22px;
  background: rgba(255,255,255,.96);
  border-radius: 28px;
  box-shadow: 0 12px 35px rgba(38,50,56,.12);
  text-align: center;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  margin-bottom: 22px;
}

.app-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: #e8f2ff;
  border-radius: 18px;
  font-size: 32px;
  flex: 0 0 auto;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(25px, 6vw, 34px);
  letter-spacing: .02em;
}

.app-header p {
  margin: 4px 0 0;
  color: #74808a;
  font-size: 13px;
}

h2 {
  line-height: 1.5;
}

button {
  display: block;
  width: 100%;
  margin: 13px 0;
  padding: 17px 15px;
  border: none;
  border-radius: 16px;
  background: #4a90e2;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(74,144,226,.18);
  transition: transform .08s ease, opacity .15s ease;
}

button:active {
  transform: scale(.985);
}

button:hover { opacity: .9; }

button:disabled {
  opacity: .6;
  cursor: default;
}

.back { background: #7b8794; }

.hidden { display: none !important; }

.rank-card {
  margin: 0 0 24px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f7fbff, #edf5ff);
  border: 1px solid #dcecff;
}

.rank-label {
  color: #6c7a86;
  font-size: 13px;
  font-weight: 700;
}

.rank-name {
  margin-top: 4px;
  font-size: 25px;
  font-weight: 900;
}

.points {
  margin-top: 4px;
  font-size: 25px;
  font-weight: 900;
}

.points span {
  font-size: 15px;
  color: #68757f;
}

.next-rank {
  margin-top: 9px;
  color: #64717b;
  font-size: 14px;
}

.next-rank strong {
  color: #4a90e2;
}

#progress {
  font-size: 16px;
  margin-bottom: 14px;
  color: #697680;
  font-weight: 700;
}

.question-box {
  background: #f6f8fb;
  padding: 20px 16px;
  border-radius: 18px;
  margin-bottom: 18px;
  border: 1px solid #e9edf2;
}

#question {
  margin: 0;
  font-size: 21px;
  line-height: 1.65;
}

.answer-button {
  background: white;
  color: #303b43;
  border: 2px solid #e0e6ec;
  box-shadow: none;
}

.answer-button:hover {
  background: #f3f7fb;
}

.correct {
  color: #e60012;
  font-size: 25px;
  font-weight: 900;
  margin: 18px 0;
}

.point-get {
  font-size: 18px;
  color: #f08a00;
}

.wrong {
  color: #303840;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.6;
  margin: 18px 0;
}

#nextButton { background: #28a745; }

#score {
  font-size: 26px;
  font-weight: 900;
  margin: 24px 0;
  line-height: 1.5;
}

#quitButton {
  background: #7b8794;
  margin-top: 20px;
  box-shadow: none;
}

@media (max-width: 480px) {
  #app {
    width: 94%;
    margin: 12px auto;
    padding: 18px;
    border-radius: 24px;
  }

  .app-header {
    margin-bottom: 18px;
  }

  button {
    padding: 16px 12px;
    font-size: 17px;
  }

  #question {
    font-size: 19px;
  }
}
