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

:root {
  --theme-primary: #2e7d32;
  --theme-hover: #388e3c;
  --theme-active: #1b5e20;
}

html {
  height: 100%;
  touch-action: manipulation;
}

body {
  width: 100%;
  height: 100%;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  display: flex;
  flex-direction: column;
}

.wrap {
  flex: 1;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

button {
  appearance: none;
  min-height: 40px;
  color: #fff;
  border: 2px solid var(--theme-primary);
  background-color: var(--theme-primary);
  border-radius: 5px;
  box-shadow: 1px 1px 2px #ccc;
  padding: 4px 8px;
  font-size: 18px;
  user-select: none;
  cursor: pointer;
  transition: all 0.2s;

  @media (hover: hover) {
    &:hover {
      background-color: var(--theme-hover);
    }
  }

  &:focus {
    background-color: var(--theme-hover);
  }

  &:active {
    background-color: var(--theme-active);
  }

  &:disabled {
    opacity: 0.65;
    pointer-events: none;
  }
}

/* start-area */
h1 {
  font-weight: normal;
  font-size: 36px;
  margin-bottom: 20px;
}

.year-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 40px 40px;
  gap: 10px;
  margin-bottom: 40px;
}

.lead {
  margin-bottom: 40px;
}

.race-select {
  background-color: #333;
  border-radius: 5px;
  box-shadow: 1px 1px 2px #ccc;
  padding: 8px;
  text-align: center;
}

.race-select {
  display: block;
  width: 150px;
  margin-left: auto;
  color: #fff;
  text-decoration: none;

  &:hover {
    opacity: 0.8;
  }

  &:active {
    opacity: 0.6;
  }
}

/* quiz-area */
.quiz-area {
  height: 600px;
  overflow: auto;
  border: 1px solid #ccc;
  position: relative;
}

.quiz-head {
  color: #fff;
  background-color: var(--theme-active);
  padding: 4px 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.question-area {
  padding: 16px;
}

.question-race-name {
  font-size: 1.4em;
  margin-bottom: 8px;
}

.year-and-jockey {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.question-year {
  font-size: 1.6em;
}

.jockey {
  border: 1px solid #333;
  margin-left: 16px;
  font-size: 14px;
}

.jockey span {
  display: inline-block;
  padding: 4px 8px;

  &:first-child {
    background: #333;
    color: #fff;
  }
}

.choiceList {
  list-style: none;
}

.choiceList li + li {
  margin-top: 12px;
}

.choiceList li button {
  width: 100%;
  color: #000;
  background: #fff;
  text-align: left;
  padding: 4px 16px;

  @media (hover: hover) {
    &:hover {
      color: #fff;
      background-color: var(--theme-hover);
    }
  }

  &:focus {
    color: #fff;
    background-color: var(--theme-hover);
  }

  &:active,
  &.selected {
    color: #fff;
    background-color: var(--theme-active);
  }
}

/* judge-area */
.judge-area {
  margin: 0 16px 16px;
  padding: 16px;
  border: 1px solid #666;
  box-shadow: 1px 1px 2px #999;
  border-radius: 5px;
}

.judge-text {
  font-size: 18px;
  margin-bottom: 12px;
  padding: 6px 12px;
  color: #fff;

  &.correct {
    background-color: #e7000b;
  }

  &.incorrect {
    background-color: #0068b7;
  }
}

.correct-text {
  font-size: 18px;
  margin-bottom: 16px;
}

.next-btn {
  width: 120px;
}

/* result-area */
.result-area {
  margin: 16px;
  padding: 32px 16px;
  text-align: center;
}

.result-title {
  font-size: 24px;
  margin-bottom: 16px;
}

.result-msg {
  font-size: 32px;
  margin-bottom: 32px;
  padding: 16px;
  border-top: 4px solid var(--theme-primary);
  border-bottom: 4px solid var(--theme-primary);
}

.reset-btn {
  width: 200px;
}

.close-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  user-select: none;
  cursor: pointer;
}

.close-btn span {
  font-size: 32px;
  color: #333;

  &:hover {
    opacity: 0.6;
  }
}

/* footer */
footer {
  width: 100%;
  background: #333;
  color: #fff;
  font-size: 14px;
  padding: 16px;
  text-align: center;
}

.footer-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

footer a {
  color: #fff;
  text-decoration: none;
}

/* 表示･非表示 */
.opacity-0 {
  opacity: 0;
  transition: opacity 0.3s;
}

.show {
  opacity: 1;
}

.hide {
  display: none;
}
