* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --theme-primary: #1a237e;
  --theme-hover: #283593;
  --theme-active: #0d1656;
}

html {
  touch-action: manipulation;
}

body {
  width: 100%;
  height: 100vh;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  display: block;
  width: 90%;
  max-width: 360px;
  min-height: 50px;
  color: #fff;
  border: 2px solid var(--theme-primary);
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
  border-radius: 5px;
  font-size: 1.3em;
  box-shadow: 1px 1px 2px #ccc;
  margin: 0 auto;
  padding: 8px 16px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
@media (hover: hover) {
  button:hover {
    background-color: var(--theme-hover);
    border-color: var(--theme-hover);
  }
}
button:focus {
  background-color: var(--theme-hover);
  border-color: var(--theme-hover);
}
button:active {
  background-color: var(--theme-active);
  border-color: var(--theme-active);
}
button:disabled {
  opacity: 0.65;
  pointer-events: none;
}

.wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
  font-size: 16px;
  text-align: center;
  background-color: #fffffe;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  position: relative;
  width: 96%;
  max-width: 640px;
  height: 96%;
  padding: 10px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.quizWrap {
  width: 100%;
  height: 100%;
  overflow: auto;
  opacity: 0;
  transform: scale(0);
  transform-origin: bottom;
  transition: opacity 0.3s, transform 0.3s;
}
.quizWrap.show {
  opacity: 1;
  transform: scale(1);
}
.quizWrap.hide {
  display: none;
}

.quizHeader {
  width: 100%;
  min-height: 50px;
  margin-bottom: 10px;
  padding: 4px 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  padding-right: 40px;
  font-weight: 400;
  font-size: 1.4em;
}

.count {
  font-size: 1.4em;
  background: var(--theme-hover);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s, transform 0.3s;
}
.count.show {
  opacity: 1;
  transform: none;
}
.count.hide {
  display: none;
}

.choiceList {
  width: 100%;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  opacity: 0;
  transform: scale(0);
  transform-origin: bottom;
  transition: opacity 0.3s, transform 0.3s;
}
.choiceList.show {
  opacity: 1;
  transform: scale(1);
}
.choiceList.hide {
  display: none;
}
.choiceList li {
  flex: 1 1 150px;
}
.choiceList button {
  width: 100%;
  color: #111;
  background-color: #fff;
  font-size: 1.1em;
}
@media (hover: hover) {
  .choiceList button:hover {
    color: #fff;
    background-color: var(--theme-hover);
  }
}
.choiceList button:focus, .choiceList button.correct {
  color: #fff;
  background-color: var(--theme-hover);
}
.choiceList button:active {
  color: #fff;
  background-color: var(--theme-active);
}

.slide {
  position: absolute;
  width: 94%;
  max-width: 480px;
  min-height: 200px;
  margin: 0 auto;
  background-color: #fffffd;
  border: 2px solid #333;
  box-shadow: 1px 1px 2px #666;
  border-radius: 5px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, -80px);
}

@keyframes slide-down {
  0%, 100% {
    transform: translate(-50%, -80px);
    opacity: 0;
  }
  10%, 90% {
    transform: translate(-50%, 200px);
    opacity: 1;
  }
}
.correctArea.show {
  animation: slide-down 1s;
}
.correctArea.hide {
  display: none;
}

.correctText {
  font-size: 1.5em;
}
.correctText:first-child {
  margin-bottom: 30px;
}

@keyframes slide-down2 {
  0% {
    transform: translate(-50%, -80px);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 200px);
    opacity: 1;
  }
}
.restartArea.show {
  animation: slide-down2 0.3s forwards;
}
.restartArea.hide {
  display: none;
}

.restartText {
  font-size: 1.5em;
  margin-bottom: 30px;
}