:root {
  color-scheme: light;
  font-family: "BIZ UDPGothic";
  color: #17263d;
  background: #0b1429;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
  linear-gradient(to bottom, #ead2f8 0%, #4e2252 100%);
    
  line-height: 1.7;
}

.game-layout {
  /* 全体を中央に置くことで、キャラクターの下のカードは中央より少し下になる */
  width: min(100%, 580px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.character {
  width: clamp(160px, 28vw, 230px);
  flex-shrink: 0;
  color: #4f4f52;
}

.character svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.character-head {
  transform-origin: 140px 160px;
  transition: transform 240ms ease;
}

.character-symbol {
  display: none;
}

.character[data-state="thinking"] .character-head {
  transform: rotate(-12deg);
}

.character[data-state="thinking"] .symbol-question,
.character[data-state="inspired"] .symbol-bulb,
.character[data-state="confident"] .symbol-exclamation {
  display: inline;
}

main {
  width: min(100%, 580px);
  padding: clamp(28px, 6vw, 52px);
  text-align: center;
  background: #f8fafc;
  border: 1px solid #ffffff;
  border-radius: 28px;
  box-shadow: 0 24px 80px #00000040;
}

h1 /*あなたの年齢を7ターン以内で当てましょう*/{
  margin: 0 0 12px;
  font-size: clamp(1.0rem, 3vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
}



#question {
  margin: 36px 0 28px;
  font-size: clamp(1.3rem, 5.2vw, 2.1rem);
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.answer-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

button {
  min-width: 0;
  min-height: 56px;
  padding: 14px 10px;
  border: 1px solid #d8e1eb;
  border-radius: 14px;
  background: #eaf0f6;
  color: #293d57;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#correct {
  border-color: #a6dc70;
  background: #b8ef88;
  color: #1c3914;
  box-shadow: 0 4px 14px #68a53724;
}

#start {
  width: 100%;
  margin-bottom: 20px;
  border-color: #a6dc70;
  background: #b8ef88;
  color: #1c3914;
}

button:focus-visible {
  outline: 3px solid #2779bc;
  outline-offset: 4px;
}

@media (hover: hover) {
  button:enabled:hover {
    transform: translateY(-3px);
    border-color: #b4c4d7;
    background: #dfe8f2;
    box-shadow: 0 6px 14px #17263d14;
  }

  #correct:enabled:hover,
  #start:enabled:hover {
    border-color: #8cc452;
    background: #a8e771;
    box-shadow: 0 6px 18px #68a53733;
  }

  #restart:enabled:hover {
    background: #eaf0f6;
  }
}

button:enabled:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: none;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

#result {
  min-height: 3.4em;
  margin: 26px 0 20px;
  color: #354b65;
  font-size: 1.1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#restart {
  min-height: 48px;
  padding: 12px 24px;
  background: transparent;
  color: #53667e;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  body {
    padding: 24px 16px;
  }

  main {
    padding: 32px 20px;
    border-radius: 22px;
  }

  #question {
    margin: 28px 0 24px;
  }

  .answer-buttons {
    gap: 8px;
  }

  button {
    padding: 14px 6px;
    border-radius: 12px;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .character-head {
    transition: none;
  }

  button:enabled:hover,
  button:enabled:active {
    transform: none;
  }
}
