* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f7;
  color: #202124;
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
}

button,
select {
  font: inherit;
}

.game {
  width: min(760px, calc(100% - 32px));
  margin: auto;
  padding: 42px 0 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #73777f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 38px);
}

.progress {
  font-weight: 700;
}

/*モード選択*/

.mode-screen {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.mode-screen h1 {
  margin: 0 0 35px;
}

.mode-list {
  width: min(500px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-button {
  width: 100%;
  padding: 20px 24px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;

  border: 1px solid #dedfe3;
  border-radius: 16px;
  background: white;

  text-align: left;
  cursor: pointer;

  transition:
    transform 0.15s,
    border-color 0.15s;
}

.mode-button:hover {
  transform: translateY(-2px);
  border-color: #aaaeb5;
}

.mode-button strong {
  font-size: 18px;
}

.mode-button span {
  color: #777b83;
  font-size: 13px;
}


/* カウントダウン */

.countdown-screen {
  position: fixed;
  inset: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  background: #f4f5f7;

  z-index: 100;
}

#countdownNumber {
  font-size: clamp(80px, 25vw, 180px);
  font-weight: 900;
  letter-spacing: -0.08em;

  animation: countdown-pop 0.8s ease;
}

@keyframes countdown-pop {
  0% {
    opacity: 0;
    transform: scale(1.5);
  }

  20% {
    opacity: 1;
    transform: scale(1);
  }

  80% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

/*ゲーム*/

.card {
  background: #fff;
  border: 1px solid #e2e4e8;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(20, 25, 35, 0.05);
}

.question-card {
  padding: 34px;
  text-align: center;
}

.timer-label {
  color: #999da5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.timer {
  margin: 4px 0 13px;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.question {
  min-height: 30px;
  margin: 0 0 5px;
  font-size: clamp(18px, 4vw, 27px);
  font-weight: 700;
}

.date-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: 700;
}

select {
  width: 105px;
  padding: 12px 14px;
  border: 1px solid #d5d8de;
  border-radius: 10px;
  background: white;
}

.primary {
  border: 0;
  border-radius: 11px;
  padding: 13px 30px;
  color: #fff;
  background: #202124;
  cursor: pointer;
  font-weight: 800;
}

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.feedback {
  min-height: 24px;
  margin: 16px 0 0;
  font-weight: 700;
}

.feedback.correct {
  color: #198754;
}

.feedback.wrong {
  color: #d33b3b;
}

.skills {
  margin-top: 30px;
}

.skills h2 {
  margin: 0 0 12px;
  color: #777b83;
  font-size: 12px;
  letter-spacing: 0.15em;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.skill {
  position: relative;
  min-height: 155px;
  padding: 18px;
  border: 1px solid #dedfe3;
  border-radius: 16px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.skill:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #aaaeb5;
}

.skill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.skill-cost {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #777b83;
  font-size: 11px;
}

.skill-icon {
  display: block;
  margin-bottom: 14px;
  font-size: 22px;
  font-weight: 900;
}

.skill-name {
  display: block;
  font-weight: 800;
}

.skill-desc {
  display: block;
  margin-top: 6px;
  color: #777b83;
  font-size: 12px;
  line-height: 1.5;
}

.hint-area {
  margin-top: 18px;
  padding: 22px;
}

.hint-title {
  margin-bottom: 8px;
  color: #777b83;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.hint-area p {
  margin: 0.5em 0;
}

.hidden {
  display: none;
}

/*リザルト*/

.result {
  margin-top: 20px;
  padding: 34px;
  text-align: center;
}

.result h2 {
  margin: 5px 0 20px;
  font-size: 28px;
}

.result-score {
  font-size: 58px;
  font-weight: 900;
}

.result-score small {
  color: #888;
  font-size: 20px;
}

.final-time {
  margin: 15px 0 24px;
  color: #777b83;
}

.final-time strong {
  color: #202124;
  font-size: 28px;
}

.penalties {
  width: min(340px, 100%);
  margin: 0 auto 28px;
  text-align: left;
  font-size: 14px;
  line-height: 1.9;
}

.penalty-total {
  padding-top: 8px;
  border-top: 1px solid #ddd;
  font-weight: 800;
}

.question-results {
  margin: 0 auto 28px;
  border-top: 1px solid #ddd;
  text-align: left;
}

.question-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid #eee;
}

.question-result-no {
  width: 24px;
  color: #888;
  font-size: 13px;
  font-weight: 700;
}

.question-result-name {
  font-weight: 700;
}

.question-result-answer {
  margin-top: 2px;
  color: #777;
  font-size: 13px;
}

@media (max-width: 620px) {
  .game {
    width: min(100% - 20px, 760px);
    padding-top: 24px;
  }

  .question-card {
    padding: 24px 16px;
  }

  .skill-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .skill {
    min-height: 120px;
    padding: 12px 8px;
  }

  .skill-icon {
    margin-bottom: 8px;
    font-size: 20px;
  }

  .skill-name {
    font-size: 13px;
  }

  .skill-desc {
    font-size: 10px;
    line-height: 1.4;
  }

  .skill-cost {
    top: 8px;
    right: 7px;
    font-size: 10px;
  }
}