:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color: #4b372d;
  font-family: system-ui, -apple-system, "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #fff7df;
}

body {
  min-height: 100dvh;
  touch-action: manipulation;
  user-select: none;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid #2357d9;
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  filter: grayscale(0.55);
  opacity: 0.65;
}

.hidden {
  display: none !important;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100dvh;
  padding: max(10px, var(--safe-top)) 10px max(10px, var(--safe-bottom));
}

.top {
  padding: 9px;
  text-align: center;
  background: #fff;
  border: 4px solid #ffbd3e;
  border-radius: 22px;
  box-shadow: 0 4px 0 #e59a13;
}

.question {
  font-size: clamp(21px, 6.2vw, 34px);
  font-weight: 900;
  line-height: 1.2;
}

.sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
  font-size: 14px;
  font-weight: 700;
}

.sound,
.restart,
.start-button,
.again {
  color: #fff;
  font-weight: 900;
  border: 0;
}

.sound {
  padding: 8px 15px;
  font-size: 17px;
  background: #55c3ff;
  border-radius: 999px;
  box-shadow: 0 4px 0 #0003;
}

.board {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(#bcecff 0 49%, #a5df72 49% 100%);
  border: 4px solid #fff;
  border-radius: 25px;
  box-shadow: inset 0 0 0 3px #72c8e8, 0 5px 15px #0002;
}

.cloud {
  position: absolute;
  font-size: 40px;
  opacity: 0.82;
}

.cloud-left {
  top: 2%;
  left: 4%;
}

.cloud-right {
  top: 14%;
  right: 6%;
}

.item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 29%;
  height: 27%;
  padding: 4px;
  background: #ffffffdf;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 6px 0 #0002, 0 3px 10px #0002;
  transition: transform 0.12s;
}

.item:active {
  transform: scale(0.93);
}

.art {
  font-size: clamp(37px, 12vw, 66px);
  line-height: 1;
}

.art svg,
.answer-art svg {
  width: 100%;
  height: 100%;
}

.art svg {
  max-height: 92px;
}

.art img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 105px;
  object-fit: contain;
  border-radius: 14px;
}

.item.icon-only .art img,
.answer-item.icon-only img {
  object-position: center;
  object-fit: contain;
  background: #fff;
}

.item.icon-only .art img {
  border-radius: 18px;
}

.item.compact .art {
  font-size: clamp(28px, 8vw, 48px);
}

.item.compact .art img {
  max-height: 82px;
}

.item.correct {
  background: #fff3a8;
  animation: pop 0.45s ease 2;
}

.item.wrong {
  animation: shake 0.3s ease;
}

.mark {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 30;
  width: min(38vw, 180px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0;
  border: 14px solid #ef3e3e;
  border-radius: 50%;
  filter: drop-shadow(0 5px 2px #0003);
  transform: translate(-50%, -50%) scale(0.3);
}

.mark.show {
  animation: mark 0.8s ease;
}

.footer {
  display: flex;
  gap: 8px;
}

.status {
  flex: 1;
  padding: 7px;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  background: #fff;
  border: 3px solid #ffcc61;
  border-radius: 16px;
}

.restart {
  padding: 7px 12px;
  font-size: 15px;
  background: #ff7a7a;
  border-radius: 16px;
  box-shadow: 0 4px 0 #d84c4c;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  text-align: center;
  background: #fff4cf;
}

.card {
  width: min(94vw, 520px);
  padding: 20px;
  background: #fff;
  border: 6px solid #ffbd3e;
  border-radius: 30px;
  box-shadow: 0 9px 0 #e59a13;
}

.card h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 9vw, 44px);
}

.section-title {
  margin: 12px 0 7px;
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.choice {
  padding: 11px 6px;
  color: #4b372d;
  font-size: 15px;
  font-weight: 900;
  background: #fff;
  border: 3px solid #ddd;
  border-radius: 15px;
}

.choice[data-value="holo"] {
  grid-column: 1 / -1;
}

.choice.selected {
  background: #fff0c9;
  border-color: #ff9f1c;
  box-shadow: inset 0 0 0 2px #ffcf66;
}

.answer-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.answer-actions button {
  flex: 1;
}

.start-button,
.again {
  width: 100%;
  padding: 13px;
  margin-top: 17px;
  font-size: 24px;
  background: #58c76f;
  border-radius: 20px;
  box-shadow: 0 6px 0 #299c43;
}

.data-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: #795548;
  font-size: 12px;
}

.data-status.ready {
  display: none;
}

.data-status.error {
  color: #b3261e;
  font-weight: 800;
}

.note {
  margin-top: 10px;
  color: #795548;
  font-size: 12px;
  line-height: 1.5;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 62vh;
  padding: 4px;
  overflow: auto;
}

.answer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  font-size: 12px;
  font-weight: 900;
  background: #fff;
  border: 3px solid #ffd36c;
  border-radius: 16px;
}

.answer-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
}

.answer-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  font-size: 45px;
  line-height: 1.2;
}

.answer-meta {
  color: #806b5d;
  font-size: 10px;
}

.score-big {
  margin: 4px;
  color: #ef6c00;
  font-size: 56px;
  font-weight: 1000;
}

.stars {
  font-size: 48px;
}

.full-width-action {
  width: 100%;
  margin-top: 12px;
}

noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 3rem 1rem;
  text-align: center;
  background: #fff4cf;
}

@keyframes pop {
  50% {
    transform: scale(1.22) rotate(7deg);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

@keyframes mark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25);
  }

  22%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.12);
  }
}
