:root {
  --bg1: #fff7d8;
  --bg2: #ffe9f1;
  --card: rgba(255, 255, 255, 0.92);
  --text: #51463c;
  --pink: #ff84ad;
  --pink-dark: #ff5d92;
  --orange: #ffb43b;
  --orange-dark: #ff8e47;
  --blue: #66b6ff;
  --blue-dark: #4d95ec;
  --green: #53b46d;
  --green-dark: #398b50;
  --yellow: #fff2a7;
  --shadow: 0 12px 30px rgba(196, 122, 94, 0.18);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: "Hiragino Kaku Gothic ProN", Meiryo, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.9) 0 3.2rem, transparent 3.4rem),
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.8) 0 2.4rem, transparent 2.6rem),
    radial-gradient(circle at 88% 82%, rgba(255, 255, 255, 0.7) 0 2.8rem, transparent 3rem),
    linear-gradient(135deg, #fff3bb 0%, #ffe6ef 48%, #e0f5ff 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  z-index: 0;
  opacity: 0.3;
  filter: blur(8px);
}

body::before {
  left: -40px;
  bottom: -30px;
  background: #ffb6cf;
}

body::after {
  right: -50px;
  top: -40px;
  background: #b6e4ff;
}

ruby rt {
  font-size: 0.42em;
  letter-spacing: 0.05em;
}

button {
  font: inherit;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  padding: 1.2vh 1.5vw;
  box-sizing: border-box;
}

.screen {
  min-height: calc(100vh - 2.4vh);
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-card {
  position: relative;
  width: min(96vw, 1360px);
  height: min(92vh, 820px);
  padding: clamp(16px, 2.4vh, 26px) clamp(18px, 2.2vw, 30px);
  background: var(--card);
  border: 4px solid rgba(255, 255, 255, 0.75);
  border-radius: 34px;
  box-shadow: var(--shadow);
  box-sizing: border-box;
  overflow: hidden;
}

.main-card::before,
.main-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  z-index: 0;
}

.main-card::before {
  width: 200px;
  height: 200px;
  right: -90px;
  bottom: -80px;
  background: rgba(255, 196, 214, 0.5);
}

.main-card::after {
  width: 180px;
  height: 180px;
  left: -80px;
  top: -70px;
  background: rgba(185, 231, 255, 0.45);
}

.sparkle {
  position: absolute;
  z-index: 0;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #fff8b0 0%, #ffd45f 70%, transparent 72%);
  transform: rotate(45deg);
  box-shadow: 0 0 18px rgba(255, 221, 92, 0.75);
}

.sparkle-1 {
  top: 10%;
  right: 18%;
}

.sparkle-2 {
  bottom: 16%;
  left: 14%;
}

.top-layout,
.last-layout,
.quiz-layout {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  gap: clamp(14px, 2vw, 28px);
}

.top-layout,
.last-layout {
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
}

.quiz-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quiz-title {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 172px;
  padding: 8px 22px 12px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  box-shadow: 0 10px 20px rgba(255, 148, 67, 0.28);
}

.quiz-title-kana {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: 0 8px;
  box-sizing: border-box;
  font-size: clamp(13px, 1vw, 17px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.12em;
}

.quiz-title-kana span:first-child {
  text-align: left;
}

.quiz-title-kana span:last-child {
  text-align: right;
}

.quiz-title-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.02em;
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.quiz-title-no {
  display: inline-block;
  min-width: 0.66em;
  text-align: center;
  font-size: 1.18em;
  line-height: 0.9;
  transform: translateY(0.03em);
}

.progress-text {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: #ff6d9e;
  background: #fff4f8;
  border: 2px solid #ffd3e3;
  white-space: nowrap;
}

.quiz-progress {
  height: 16px;
  border-radius: 999px;
  background: #ffe8b7;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.quiz-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff93bd 0%, #ffca56 60%, #8ed17d 100%);
}

.quiz-layout {
  grid-template-columns: minmax(0, 0.55fr) minmax(280px, 0.45fr);
  align-items: stretch;
  min-height: 0;
  flex: 1;
}

.quiz-content,
.visual-panel,
.top-left,
.top-right,
.last-visual,
.last-content {
  min-height: 0;
}

.quiz-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(10px, 1.8vh, 18px);
}

.question-bubble {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf5 100%);
  border: 3px solid #ffd787;
  border-radius: var(--radius-xl);
  padding: clamp(16px, 2.3vh, 26px) clamp(18px, 1.8vw, 24px);
  box-shadow: 0 8px 20px rgba(255, 201, 97, 0.18);
}

.question-bubble::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -12px;
  width: 24px;
  height: 24px;
  background: #fffdf5;
  border-right: 3px solid #ffd787;
  border-bottom: 3px solid #ffd787;
  transform: rotate(45deg);
}

.question-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7fc9ff 0%, #4ca6ff 100%);
  color: #fff;
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 800;
}

.q-text {
  margin: 0;
  font-size: clamp(23px, 2vw, 34px);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.button-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 1.4vh, 14px);
}

.quiz-button,
.next-button,
.start-button,
.back-button {
  border: none;
  border-radius: 20px;
  cursor: pointer;
  color: #fff;
  font-weight: 800;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.quiz-button:hover,
.next-button:hover,
.start-button:hover,
.back-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.quiz-button:active,
.next-button:active,
.start-button:active,
.back-button:active {
  transform: scale(0.985);
}

.quiz-button {
  position: relative;
  text-align: left;
  font-size: clamp(20px, 1.55vw, 27px);
  line-height: 1.45;
  padding: clamp(14px, 1.8vh, 18px) clamp(18px, 1.8vw, 24px) clamp(14px, 1.8vh, 18px) 24px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  box-shadow: 0 10px 18px rgba(76, 153, 236, 0.22);
}

.quiz-button::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 70%;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.4);
}

.quiz-button:disabled {
  cursor: not-allowed;
}

.quiz-button.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.25);
  box-shadow: none;
}

.quiz-button.is-selected-correct {
  opacity: 1;
  background: linear-gradient(135deg, #66d681 0%, #38a957 100%);
  box-shadow: 0 0 0 5px rgba(94, 213, 125, 0.25), 0 10px 18px rgba(57, 139, 80, 0.25);
}

.quiz-button.is-selected-wrong {
  opacity: 1;
  background: linear-gradient(135deg, #ff8cae 0%, #ff5f91 100%);
  box-shadow: 0 0 0 5px rgba(255, 135, 174, 0.22), 0 10px 18px rgba(255, 95, 145, 0.2);
}

.quiz-button:disabled:hover {
  transform: none;
  filter: none;
}

.next-container {
  display: flex;
  justify-content: flex-start;
}

.next-button,
.back-button {
  min-width: 180px;
  padding: 14px 28px;
  font-size: clamp(20px, 1.6vw, 28px);
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: 0 10px 18px rgba(57, 139, 80, 0.25);
}

.next-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.35);
  box-shadow: none;
  transform: none;
}

.next-button:disabled:hover {
  transform: none;
  filter: grayscale(0.35);
}

.visual-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.nono-guide {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.visual-speech {
  position: relative;
  align-self: flex-start;
  padding: 12px 16px;
  border-radius: 18px;
  background: #fff5fb;
  color: #ff669c;
  border: 2px solid #ffd0e1;
  font-size: clamp(15px, 1.2vw, 19px);
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 16px rgba(255, 159, 196, 0.18);
}

.visual-speech::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 58%;
  width: 16px;
  height: 16px;
  background: #fff5fb;
  border-top: 2px solid #ffd0e1;
  border-right: 2px solid #ffd0e1;
  transform: translateY(-50%) rotate(45deg);
}

.nono-character-wrap {
  position: relative;
  width: clamp(92px, 10vw, 140px);
  height: clamp(92px, 10vw, 140px);
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}

.nono-halo {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,243,190,0.85) 45%, rgba(255,214,149,0.35) 75%, rgba(255,214,149,0) 100%);
}

.nono-character {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(120, 88, 30, 0.18));
}

.image-stage,
.hero-illustration {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
}

.image-stage {
  flex: 1;
  min-height: 0;
  padding: 18px;
  border: 3px dashed #ffc1d9;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.9) 0 2rem, transparent 2.1rem),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.85) 0 1.8rem, transparent 1.9rem),
    radial-gradient(circle at 75% 82%, rgba(255, 255, 255, 0.85) 0 2.2rem, transparent 2.3rem),
    linear-gradient(180deg, #eaf8ff 0%, #fff8cc 100%);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.4);
}

.hero-illustration {
  min-height: 320px;
  padding: 24px;
  background: linear-gradient(180deg, #dff2ff 0%, #fff6ce 100%);
  border: 3px dashed #b9deff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8cb5 0%, #ffb454 100%);
  color: #fff;
  font-size: clamp(16px, 1.4vw, 22px);
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(255, 141, 85, 0.2);
}

.top-image,
.last-image,
.quiz-image {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.top-image,
.last-image {
  max-height: 54vh;
}

.quiz-image {
  width: 100%;
  height: 100%;
}

.stage-cloud,
.hero-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
}

.stage-cloud::before,
.stage-cloud::after,
.hero-cloud::before,
.hero-cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: inherit;
}

.stage-cloud-1,
.cloud-a {
  width: 88px;
  height: 34px;
  left: 18px;
  top: 22px;
}

.stage-cloud-2,
.cloud-b {
  width: 110px;
  height: 38px;
  right: 24px;
  bottom: 28px;
}

.stage-cloud-1::before,
.cloud-a::before {
  width: 36px;
  height: 36px;
  left: 10px;
  top: -14px;
}

.stage-cloud-1::after,
.cloud-a::after {
  width: 42px;
  height: 42px;
  right: 12px;
  top: -18px;
}

.stage-cloud-2::before,
.cloud-b::before {
  width: 40px;
  height: 40px;
  left: 16px;
  top: -16px;
}

.stage-cloud-2::after,
.cloud-b::after {
  width: 46px;
  height: 46px;
  right: 14px;
  top: -20px;
}

.visual-bg {
  position: absolute;
  inset: auto;
  opacity: 0.5;
  pointer-events: none;
}

.deco-star {
  left: 12px;
  bottom: 18px;
  width: 70px;
  height: 70px;
  background:
    radial-gradient(circle at 50% 0%, #ffe072 0 10px, transparent 11px),
    radial-gradient(circle at 50% 100%, #ffe072 0 10px, transparent 11px),
    radial-gradient(circle at 0% 50%, #ffe072 0 10px, transparent 11px),
    radial-gradient(circle at 100% 50%, #ffe072 0 10px, transparent 11px);
  filter: drop-shadow(0 0 6px rgba(255, 210, 80, 0.65));
}

.deco-dot {
  top: 40px;
  right: 10px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 182, 0.9) 0 4px, transparent 5px) 0 0 / 18px 18px;
}

.top-right,
.last-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 2vh, 18px);
}

.title {
  margin: 0;
  font-size: clamp(34px, 3vw, 54px);
  line-height: 1.2;
  color: #ff7e39;
  text-shadow: 0 2px 0 #fff6de;
}

.subtitle {
  margin: 0;
  font-size: clamp(21px, 1.8vw, 30px);
  line-height: 1.7;
  font-weight: 800;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #ffd7a3;
  color: #ff8d4f;
  font-size: clamp(15px, 1.2vw, 20px);
  font-weight: 800;
}

.start-button {
  align-self: flex-start;
  padding: 16px 30px;
  font-size: clamp(24px, 1.8vw, 32px);
  background: linear-gradient(135deg, var(--orange) 0%, var(--pink-dark) 100%);
  box-shadow: 0 12px 20px rgba(255, 136, 112, 0.25);
}

.supervisor {
  margin: 0;
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.6;
}

.last-message {
  font-size: clamp(28px, 2.2vw, 40px);
  color: #f08a1c;
  font-weight: 900;
  line-height: 1.45;
}

.score-message {
  font-size: clamp(24px, 1.9vw, 32px);
  color: #4a6278;
  font-weight: 800;
}

.score-message strong {
  color: #ff5d92;
  font-size: 1.2em;
}

.small-message {
  font-size: clamp(18px, 1.4vw, 25px);
  line-height: 1.7;
  font-weight: 700;
}

.secret-message {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 20px;
  background: #fff0f5;
  color: #ff538e;
  border: 2px dashed #ff9cc0;
  font-size: clamp(20px, 1.6vw, 28px);
  font-weight: 900;
}

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 36px));
  padding: 24px 28px;
  box-sizing: border-box;
  border-radius: 26px;
  color: #5a4330;
  font-size: clamp(28px, 2.4vw, 40px);
  font-weight: 900;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 20px 40px rgba(112, 71, 45, 0.25);
}

.popup.show {
  display: block;
  animation: pop 0.28s ease;
}

.popup-correct {
  background: linear-gradient(180deg, #fff9c9 0%, #fff1a7 100%);
  border: 4px solid #ffcf4b;
}

.popup-wrong {
  background: linear-gradient(180deg, #ffeef4 0%, #ffdbe8 100%);
  border: 4px solid #ff8fb6;
}

.popup-text {
  margin-top: 10px;
  font-size: clamp(18px, 1.45vw, 25px);
  line-height: 1.7;
  font-weight: 700;
}

@keyframes pop {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .main-card {
    width: min(97vw, 1280px);
    height: min(94vh, 820px);
  }

  .quiz-layout {
    grid-template-columns: minmax(0, 0.58fr) minmax(250px, 0.42fr);
  }

  .q-text {
    font-size: clamp(22px, 1.9vw, 30px);
  }

  .quiz-button {
    font-size: clamp(18px, 1.45vw, 24px);
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    padding: 10px;
  }

  .main-card {
    height: auto;
    min-height: calc(100vh - 20px);
  }

  .top-layout,
  .last-layout,
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .hero-illustration,
  .image-stage {
    min-height: 230px;
  }

  .quiz-content {
    order: 2;
  }

  .visual-panel {
    order: 1;
  }
}

@media (orientation: landscape) and (max-width: 950px) {
  body {
    overflow: hidden;
  }

  .app {
    padding: 8px;
  }

  .screen {
    min-height: calc(100vh - 16px);
  }

  .main-card {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    min-height: 0;
    padding: 12px 14px;
    border-radius: 22px;
  }

  .top-layout,
  .last-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 14px;
  }

  .quiz-layout {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 14px;
  }

  .title {
    font-size: clamp(24px, 3.2vw, 38px);
  }

  .subtitle {
    font-size: clamp(16px, 1.8vw, 22px);
    line-height: 1.55;
  }

  .hero-illustration,
  .last-illustration {
    min-height: 0;
    height: 100%;
    padding: 14px;
  }

  .top-image,
  .last-image {
    max-height: 58vh;
  }

  .quiz-title {
    min-width: 132px;
    padding: 6px 16px 9px;
  }

  .quiz-title-kana {
    font-size: clamp(10px, 1.3vw, 13px);
  }

  .quiz-title-main {
    font-size: clamp(24px, 3.1vw, 36px);
  }

  .progress-text {
    font-size: 14px;
    padding: 6px 10px;
  }

  .quiz-progress {
    height: 12px;
  }

  .question-bubble {
    padding: 12px 14px;
  }

  .question-label {
    margin-bottom: 6px;
    font-size: 14px;
  }

  .q-text {
    font-size: clamp(18px, 2vw, 26px);
    line-height: 1.42;
  }

  .button-container {
    gap: 8px;
  }

  .quiz-button {
    padding: 10px 16px 10px 21px;
    font-size: clamp(15px, 1.5vw, 20px);
    line-height: 1.34;
    border-radius: 16px;
  }

  .quiz-button::before {
    left: 10px;
    width: 6px;
  }

  .next-button,
  .back-button,
  .start-button {
    padding: 11px 20px;
    border-radius: 16px;
    font-size: clamp(18px, 1.7vw, 24px);
  }

  .nono-guide {
    gap: 8px;
  }

  .visual-speech {
    padding: 8px 12px;
    font-size: 13px;
  }

  .visual-speech::after {
    right: -7px;
    top: 58%;
    width: 12px;
    height: 12px;
  }

  .nono-character-wrap {
    width: 82px;
    height: 82px;
  }

  .image-stage {
    padding: 10px;
  }

  .popup {
    width: min(520px, calc(100vw - 24px));
    padding: 18px 20px;
    font-size: clamp(22px, 2.6vw, 30px);
  }

  .popup-text {
    font-size: clamp(15px, 1.45vw, 19px);
    line-height: 1.5;
  }

  .last-message {
    font-size: clamp(22px, 2.1vw, 30px);
  }

  .score-message {
    font-size: clamp(18px, 1.6vw, 24px);
  }

  .small-message,
  .secret-message,
  .supervisor,
  .feature-pill {
    font-size: clamp(12px, 1.25vw, 16px);
  }

  .feature-row {
    gap: 6px;
  }

  .hero-badge {
    margin-bottom: 8px;
    padding: 6px 12px;
    font-size: clamp(12px, 1.3vw, 16px);
  }
}

/* iPad 第7世代など、横向き 1024×768 前後で下が切れないようにする調整 */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 850px) {
  body {
    overflow: hidden;
  }

  .app {
    padding: 6px 8px;
    min-height: 100svh;
    min-height: 100dvh;
  }

  .screen {
    min-height: calc(100svh - 12px);
    min-height: calc(100dvh - 12px);
  }

  .main-card {
    width: calc(100vw - 16px);
    height: calc(100svh - 12px);
    height: calc(100dvh - 12px);
    min-height: 0;
    padding: 10px 12px;
    border-width: 3px;
    border-radius: 24px;
  }

  .quiz-card {
    gap: 8px;
  }

  .quiz-header {
    gap: 6px;
    flex: 0 0 auto;
  }

  .quiz-title {
    min-width: 128px;
    padding: 5px 14px 8px;
    border-radius: 18px;
  }

  .quiz-title-kana {
    font-size: 11px;
  }

  .quiz-title-main {
    font-size: 30px;
  }

  .quiz-title-no {
    line-height: 0.88;
  }

  .progress-text {
    padding: 5px 9px;
    font-size: 13px;
  }

  .quiz-progress {
    height: 10px;
  }

  .quiz-layout {
    grid-template-columns: minmax(0, 1.18fr) minmax(245px, 0.82fr);
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
  }

  .quiz-content {
    gap: 7px;
    min-height: 0;
  }

  .question-bubble {
    padding: 10px 12px;
    border-width: 2px;
    border-radius: 20px;
  }

  .question-bubble::after {
    right: 20px;
    bottom: -9px;
    width: 16px;
    height: 16px;
    border-width: 2px;
  }

  .question-label {
    margin-bottom: 4px;
    padding: 4px 10px;
    font-size: 13px;
  }

  .q-text {
    font-size: clamp(17px, 2.05vw, 23px);
    line-height: 1.34;
  }

  .button-container {
    gap: 6px;
  }

  .quiz-button {
    padding: 8px 12px 8px 19px;
    border-radius: 14px;
    font-size: clamp(15px, 1.65vw, 19px);
    line-height: 1.25;
    box-shadow: 0 7px 12px rgba(76, 153, 236, 0.18);
  }

  .quiz-button::before {
    left: 9px;
    width: 6px;
  }

  .next-container {
    margin-top: 0;
  }

  .next-button,
  .back-button {
    min-width: 145px;
    padding: 8px 18px;
    border-radius: 14px;
    font-size: 19px;
  }

  .visual-panel {
    gap: 6px;
    justify-content: stretch;
  }

  .nono-guide {
    gap: 6px;
    flex: 0 0 auto;
  }

  .visual-speech {
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.35;
  }

  .visual-speech::after {
    right: -7px;
    width: 12px;
    height: 12px;
  }

  .nono-character-wrap {
    width: 72px;
    height: 72px;
  }

  .nono-halo {
    inset: 7px;
  }

  .image-stage {
    padding: 8px;
    border-width: 2px;
    border-radius: 22px;
    box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.35);
  }

  .stage-cloud-1,
  .cloud-a {
    width: 64px;
    height: 24px;
    left: 12px;
    top: 16px;
  }

  .stage-cloud-2,
  .cloud-b {
    width: 78px;
    height: 28px;
    right: 14px;
    bottom: 18px;
  }

  .deco-star,
  .deco-dot {
    transform: scale(0.75);
  }

  .popup {
    width: min(560px, calc(100vw - 24px));
    padding: 16px 18px;
    border-radius: 22px;
    font-size: clamp(22px, 2.4vw, 30px);
  }

  .popup-text {
    margin-top: 8px;
    font-size: clamp(15px, 1.5vw, 20px);
    line-height: 1.5;
  }

  .top-layout,
  .last-layout {
    grid-template-columns: 0.86fr 1.14fr;
    gap: 14px;
  }

  .hero-illustration,
  .last-illustration {
    min-height: 0;
    height: 100%;
    padding: 14px;
    border-radius: 22px;
  }

  .top-image,
  .last-image {
    max-height: 58vh;
  }

  .hero-badge {
    margin-bottom: 8px;
    padding: 6px 12px;
    font-size: 14px;
  }

  .title {
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.15;
  }

  .subtitle {
    font-size: clamp(16px, 1.8vw, 22px);
    line-height: 1.5;
  }

  .feature-row {
    gap: 6px;
  }

  .feature-pill,
  .supervisor {
    font-size: 13px;
  }

  .start-button {
    padding: 10px 20px;
    border-radius: 16px;
    font-size: 22px;
  }

  .last-message {
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.35;
  }

  .score-message {
    font-size: clamp(18px, 1.8vw, 24px);
  }

  .small-message,
  .secret-message {
    font-size: clamp(14px, 1.45vw, 18px);
  }

  .secret-message {
    padding: 8px 12px;
    border-radius: 16px;
  }
}

/* 横画面でも上下にスクロールできるようにする最終調整 */
@media (orientation: landscape) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .app {
    min-height: 100svh;
    min-height: 100dvh;
    padding-bottom: 16px;
  }

  .screen {
    align-items: flex-start;
    min-height: auto !important;
    padding: 8px 0 16px;
    box-sizing: border-box;
  }

  .main-card {
    height: auto !important;
    min-height: calc(100svh - 24px);
    min-height: calc(100dvh - 24px);
    overflow: visible;
  }

  .top-layout,
  .last-layout,
  .quiz-layout {
    height: auto;
    min-height: 0;
  }

  .quiz-card {
    min-height: calc(90svh);
    min-height: calc(90dvh);
  }

  .image-stage {
    min-height: clamp(220px, 48vh, 380px);
  }

  .hero-illustration,
  .last-illustration {
    min-height: clamp(220px, 50vh, 400px);
  }
}
