﻿* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation; /*タブレット連打時の拡大防止 */
}

body {
  font-family: 'Hiragino Maru Gothic ProN', 'BIZ UDPGothic', 'Kosugi Maru', sans-serif;
  background: linear-gradient(135deg, #fff9c4 0%, #ffe0b2 50%, #f8bbd9 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.container {
  max-width: 1196px;
  width: 100%;
  height: 540px;
  background: linear-gradient(160deg, #fffde7 0%, #fff8e1 100%);
  border-radius: 32px;
  box-shadow: 0 12px 60px rgba(255, 160, 0, 0.25), 0 2px 16px rgba(0, 0, 0, 0.1);
  border: 4px solid #ffca28;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}


.deco {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.deco1 {
  width: 220px;
  height: 220px;
  background: #66bb6a;
  top: -70px;
  left: -70px;
}

.deco2 {
  width: 160px;
  height: 160px;
  background: #ffa726;
  bottom: -50px;
  right: -40px;
}

.deco3 {
  width: 110px;
  height: 110px;
  background: #42a5f5;
  top: 30px;
  right: 60px;
}

.deco4 {
  width: 90px;
  height: 90px;
  background: #ec407a;
  bottom: 50px;
  left: 80px;
}


.game-header {
  position: relative;
  z-index: 2;
  height: 50px;
  flex: 0 0 50px;
  text-align: center;
  padding: 4px 14px;
  background: linear-gradient(90deg, #ff8f00, #ffd54f, #ff8f00);
  border-bottom: 3px dashed #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-header h1 {
  font-size: 20px;
  color: #fff;
  text-shadow: 0 2px 0 #e65100, 0 4px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 2px;
}

.game-header h1 .emoji {
  font-size: 22px;
  vertical-align: middle;
}

#score-bar {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 0;
  font-size: 12px;
  color: #fff8e1;
}

#score-bar .badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 1px 10px;
  font-weight: bold;
  letter-spacing: 1px;
}


.game-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


.screen {
  display: none;
  width: 100%;
  height: 100%;
}

.screen.active {
  display: flex;
}


#screen-title {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 28px;
}


.title-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.title-logo {
  font-size: 40px;
  font-weight: bold;
  color: #e65100;
  text-shadow: 0 2px 0 #ffcc80;
  letter-spacing: 3px;
  line-height: 1.4;
  text-align: center;
}

.title-logo span {
  font-size: 48px;
  display: block;
}

.btn-start {
  background: linear-gradient(135deg, #66bb6a, #43a047);
  color: #fff;
  font-size: 26px;
  font-family: inherit;
  border: none;
  border-radius: 50px;
  padding: 16px 76px;
  cursor: pointer;
  box-shadow: 0 6px 0 #2e7d32, 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.1s;
  letter-spacing: 3px;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #2e7d32, 0 10px 24px rgba(0, 0, 0, 0.2);
}

.btn-start:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2e7d32;
}


.title-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.title-soy-wrap {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  background: url('assets/daizu.png') center / contain no-repeat;
  animation: soy-idle 2.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
}


.title-bubble {
  background: #fff;
  border: 3px solid #42a5f5;
  border-radius: 20px;
  padding: 18px 22px;
  position: relative;
  box-shadow: 0 4px 14px rgba(66, 165, 245, 0.25);
  max-width: 270px;
  margin-left: 14px;
}

.title-bubble::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 10px solid transparent;
  border-right-color: #42a5f5;
}

.title-bubble::after {
  content: '';
  position: absolute;
  right: calc(100% - 5px);
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #fff;
}

.title-bubble p {
  font-size: 20px;
  color: #0d47a1;
  line-height: 1.75;
  font-weight: bold;
  text-align: left;
}


#screen-quiz {
  flex-direction: column;
  padding: 8px 16px 10px;
  gap: 8px;
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.progress-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
}

.progress-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #8fa3b8;
  border: 2px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}

.progress-dot.is-current {
  width: 20px;
  height: 20px;
  background: #ffd43b;
  border-color: #ffe680;
  box-shadow: 0 0 0 2px rgba(255, 212, 59, 0.2), 0 0 12px rgba(255, 212, 59, 0.72);
}

.progress-dot.is-done {
  background: #ffc247;
  border-color: #ffd98a;
}

.q-count {
  font-size: 15px;
  color: #795548;
  white-space: nowrap;
  font-weight: bold;
}


.question-area {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 20px;
  border: 3px solid #90caf9;
  padding: 8px 16px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.question-label {
  font-size: 15px;
  color: #1565c0;
  letter-spacing: 2px;
  font-weight: bold;
  text-align: center;
  flex-shrink: 0;
}

.question-body {
  display: flex;
  align-items: center;
  gap: 14px;
}


.soy-character {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  background: url('assets/daizu.png') center / contain no-repeat;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  animation: soy-idle 2.4s ease-in-out infinite;
}

@keyframes soy-idle {

  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-6px) rotate(2deg);
  }
}


.speech-bubble {
  flex: 1;
  background: #fff;
  border: 3px solid #42a5f5;
  border-radius: 18px;
  padding: 12px 18px;
  position: relative;
  box-shadow: 0 3px 10px rgba(66, 165, 245, 0.2);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #42a5f5;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-right-color: #fff;
}

.speech-hint {
  font-size: 18px;
  color: #0d47a1;
  line-height: 1.65;
  font-weight: bold;
}


.answers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex: 1;
}

.ans-btn {
  background: linear-gradient(160deg, #fff9c4, #fff59d);
  border: 3px solid #f9a825;
  border-radius: 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  color: #5d4037;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  transition: all 0.12s;
  box-shadow: 0 4px 0 #f9a825, 0 5px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.ans-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 #f9a825, 0 8px 14px rgba(0, 0, 0, 0.15);
  background: linear-gradient(160deg, #fff8e1, #ffe082);
}

.ans-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #f9a825;
}

.ans-btn:disabled {
  cursor: default;
}


.ans-img {
  width: 100%;
  height: 150px;
  flex: 1 1 auto;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.ans-emoji-fallback {
  font-size: 52px;
  line-height: 1;
}

.ans-label {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.25;
  text-align: center;
  word-break: keep-all;
}

.ans-btn.correct {
  background: linear-gradient(160deg, #c8e6c9, #a5d6a7) !important;
  border-color: #388e3c !important;
  box-shadow: 0 4px 0 #2e7d32, 0 0 20px rgba(76, 175, 80, 0.5) !important;
  animation: pop 0.4s ease;
}

.ans-btn.wrong {
  background: linear-gradient(160deg, #ffcdd2, #ef9a9a) !important;
  border-color: #e53935 !important;
  box-shadow: 0 4px 0 #b71c1c !important;
  animation: shake 0.4s ease;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

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


#feedback-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
  border-radius: 28px;
  text-align: center;
  padding: 28px;
  animation: fadeIn 0.2s ease;
}

#feedback-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

.fb-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fb-soy-img {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  background: url('assets/daizu.png') center / contain no-repeat;
}

.fb-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
}

.fb-title {
  font-size: 44px;
  font-weight: bold;
  line-height: 1.1;
}

.fb-title.ok {
  color: #2e7d32;
}

.fb-title.ng {
  color: #c62828;
}

.fb-food-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fb-food-img {
  width: 126px;
  height: 126px;
  object-fit: contain;
  border-radius: 14px;
  display: none;
}

.fb-food-emoji-fb {
  font-size: 82px;
  line-height: 1;
  display: none;
}

.fb-food-name {
  font-size: 34px;
  font-weight: bold;
  color: #e65100;
}

.fb-desc {
  font-size: 20px;
  color: #4e342e;
  background: #fff8e1;
  border-radius: 16px;
  padding: 14px 22px;
  border: 2px solid #ffe082;
  line-height: 1.8;
  max-width: 740px;
  text-align: center;
}

.trivia-badge {
  display: inline-block;
  background: #e8f5e9;
  border: 2px solid #a5d6a7;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 14px;
  color: #1b5e20;
  margin-bottom: 4px;
}

.btn-next {
  background: linear-gradient(135deg, #ff8f00, #ffa000);
  color: #fff;
  font-size: 24px;
  font-family: inherit;
  border: none;
  border-radius: 50px;
  padding: 12px 56px;
  cursor: pointer;
  box-shadow: 0 5px 0 #e65100, 0 7px 16px rgba(0, 0, 0, 0.2);
  letter-spacing: 2px;
  transition: all 0.1s;
}

.btn-next:hover {
  transform: translateY(-2px);
}

.btn-next:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #e65100;
}


#screen-result {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.result-clear-img {
  width: 132px;
  height: 132px;
  background: url('assets/daizu.png') center / contain no-repeat;
  animation: soy-idle 2s ease-in-out infinite;
}

.result-stars {
  font-size: 52px;
  letter-spacing: 6px;
}

.result-title {
  font-size: 34px;
  color: #e65100;
  font-weight: bold;
  text-shadow: 0 2px 0 #ffcc80;
}

.result-msg {
  font-size: 19px;
  color: #5d4037;
  line-height: 1.7;
  white-space: pre-line;
}

.result-btns {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.btn-retry {
  background: linear-gradient(135deg, #ab47bc, #8e24aa);
  color: #fff;
  font-size: 18px;
  font-family: inherit;
  border: none;
  border-radius: 50px;
  padding: 12px 40px;
  cursor: pointer;
  box-shadow: 0 5px 0 #6a1b9a;
  transition: all 0.1s;
  letter-spacing: 2px;
}

.btn-retry:hover {
  transform: translateY(-2px);
}

.btn-retry:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #6a1b9a;
}

.btn-quit {
  font-size: 18px;
  padding: 12px 32px;
}


.floater {
  position: absolute;
  pointer-events: none;
  font-size: 28px;
  z-index: 20;
  opacity: 0.7;
  animation: float linear 1 forwards;
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }

  100% {
    transform: translateY(-110px) rotate(25deg);
    opacity: 0;
  }
}