:root {
  --pcq-paper: #fff8e7;
  --pcq-card: #ffffff;
  --pcq-ink: #25314d;
  --pcq-muted: #667085;
  --pcq-orange: #c2411b;
  --pcq-orange-dark: #9f3211;
  --pcq-yellow: #ffd857;
  --pcq-blue: #2867d8;
  --pcq-blue-dark: #174aa8;
  --pcq-green: #259653;
  --pcq-green-dark: #155f34;
  --pcq-red: #d84640;
  --pcq-red-dark: #8c2626;
  --pcq-line: #e8e2d4;
  --pcq-focus: #7a4b00;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 0;
  margin: 0;
  background: var(--pcq-paper);
  color: var(--pcq-ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

button {
  font: inherit;
}

.pcq-main {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: calc(100svh - var(--dm-common-header-height, 58px));
  place-items: center;
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.pcq-decor {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  opacity: .55;
}

.pcq-decor--one {
  top: 15%;
  left: -70px;
  width: 180px;
  height: 180px;
  background: #bfe7d4;
}

.pcq-decor--two {
  right: -60px;
  bottom: 8%;
  width: 150px;
  height: 150px;
  background: #cfe1ff;
}

.pcq-game-card {
  width: min(100%, 760px);
  min-width: 0;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--pcq-line);
  border-radius: 28px;
  background: var(--pcq-card);
  box-shadow: 0 18px 50px rgba(76, 62, 35, .12);
}

.pcq-start-screen {
  text-align: center;
}

.pcq-title-mark {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 22px 22px 22px 8px;
  background: var(--pcq-orange);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 7px 0 #8f2f11;
  transform: rotate(-3deg);
}

.pcq-eyebrow {
  margin: 0;
  color: var(--pcq-orange-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .18em;
}

.pcq-start-screen h1 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 7vw, 52px);
  line-height: 1.2;
  letter-spacing: .02em;
}

.pcq-lead {
  margin: 0;
  color: var(--pcq-muted);
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 700;
  line-height: 1.7;
}

.pcq-mode-list {
  display: grid;
  gap: 14px;
  width: min(100%, 590px);
  margin: 32px auto 0;
}

.pcq-mode-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  padding: 14px 18px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .17);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.pcq-mode-button--ten {
  background: var(--pcq-orange);
}

.pcq-mode-button--all {
  background: var(--pcq-blue);
}

.pcq-mode-number {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 18px;
  background: rgba(255, 255, 255, .18);
  font-size: 23px;
  font-weight: 900;
}

.pcq-mode-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.pcq-mode-copy strong {
  font-size: clamp(17px, 3.5vw, 21px);
  line-height: 1.35;
}

.pcq-mode-copy small {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.pcq-mode-arrow {
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
}

.pcq-mode-button:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .17);
}

.pcq-mode-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .17);
}

.pcq-mode-button:focus-visible {
  outline: 4px solid var(--pcq-focus);
  outline-offset: 4px;
}

.pcq-start-note {
  margin: 24px 0 0;
  color: var(--pcq-muted);
  font-size: 14px;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.pcq-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pcq-progress-text,
.pcq-score-text {
  margin: 0;
  font-size: clamp(15px, 3vw, 18px);
  font-weight: 900;
}

.pcq-progress-text {
  color: var(--pcq-muted);
}

.pcq-score-text {
  color: var(--pcq-orange-dark);
}

.pcq-progress-track {
  height: 11px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee9df;
}

.pcq-progress-track span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pcq-yellow), var(--pcq-orange));
  transition: width .25s ease;
}

.pcq-question-card {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 34px) 20px;
  border: 2px solid #dce9ff;
  border-radius: 22px;
  background: #f4f8ff;
  text-align: center;
}

.pcq-question-label {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--pcq-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .12em;
}

.pcq-question-card h2 {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  font-size: clamp(23px, 5vw, 34px);
  line-height: 1.45;
}

.pcq-question-card h2:focus-visible,
.pcq-result-screen h2:focus-visible,
.pcq-map-heading h3:focus-visible {
  border-radius: 5px;
  outline: 3px dashed var(--pcq-focus);
  outline-offset: 6px;
}

.pcq-answer-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 20px;
}

.pcq-answer-button {
  position: relative;
  min-width: 0;
  min-height: 64px;
  padding: 12px 44px 12px 16px;
  overflow-wrap: anywhere;
  border: 2px solid #7b8495;
  border-radius: 16px;
  background: #fff;
  color: var(--pcq-ink);
  font-size: clamp(17px, 3vw, 20px);
  font-weight: 900;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.pcq-answer-button::before {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 22px;
  height: 22px;
  border: 2px solid #7b8495;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}

.pcq-answer-button:hover:not(:disabled) {
  border-color: var(--pcq-blue);
  background: #f4f8ff;
  transform: translateY(-2px);
}

.pcq-answer-button:focus-visible,
.pcq-next-button:focus-visible,
.pcq-primary-button:focus-visible,
.pcq-secondary-button:focus-visible {
  outline: 4px solid var(--pcq-focus);
  outline-offset: 3px;
}

.pcq-answer-button:disabled {
  opacity: 1;
  cursor: default;
}

.pcq-answer-button.is-correct {
  border-color: #259653;
  background: #dff7e7;
  color: #155f34;
}

.pcq-answer-button.is-correct::before {
  display: grid;
  place-items: center;
  border-color: #259653;
  background: #259653;
  color: #fff;
  content: "✓";
  font-size: 15px;
  line-height: 1;
}

.pcq-answer-button.is-wrong {
  border-color: #d84640;
  background: #ffe3df;
  color: #8c2626;
}

.pcq-answer-button.is-wrong::before {
  display: grid;
  place-items: center;
  border-color: #d84640;
  background: #d84640;
  color: #fff;
  content: "×";
  font-size: 17px;
  line-height: 1;
}

.pcq-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: baseline;
  justify-content: center;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 15px;
  text-align: center;
}

.pcq-feedback strong {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 900;
}

.pcq-feedback span {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.pcq-feedback.is-correct {
  background: #e7f8ec;
  color: #155f34;
}

.pcq-feedback.is-wrong {
  background: #fff0ed;
  color: #8c2626;
}

.pcq-answer-map {
  margin-top: 18px;
  padding: clamp(16px, 3vw, 22px);
  scroll-margin-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  border: 2px solid #d9e6f2;
  border-radius: 20px;
  background: #f8fbff;
}

.pcq-answer-map.is-correct {
  border-color: #b9e5c8;
}

.pcq-answer-map.is-wrong {
  border-color: #f2c4bf;
}

.pcq-map-heading {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pcq-map-status-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.pcq-answer-map.is-correct .pcq-map-status-icon {
  background: var(--pcq-green);
}

.pcq-answer-map.is-wrong .pcq-map-status-icon {
  background: var(--pcq-red);
}

.pcq-map-heading p {
  margin: 0 0 2px;
  color: var(--pcq-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}

.pcq-map-heading h3 {
  display: inline-block;
  margin: 0;
  font-size: clamp(19px, 4vw, 25px);
  line-height: 1.35;
}

.pcq-map-description {
  margin: 10px 0 13px;
  color: var(--pcq-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.pcq-map-viewport {
  position: relative;
  width: 100%;
  height: clamp(220px, 43vw, 320px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #bcd2e2;
  border-radius: 16px;
  background: #eaf6fb;
}

.pcq-map-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pcq-map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  background: rgba(234, 246, 251, .92);
  color: var(--pcq-muted);
  font-size: 14px;
  font-weight: 900;
}

.pcq-map-loading.is-error {
  padding: 18px;
  color: var(--pcq-red-dark);
  text-align: center;
}

.pcq-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 12px;
  color: var(--pcq-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.pcq-map-legend > span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.pcq-map-area-key {
  width: 22px;
  height: 15px;
  border: 2px solid var(--pcq-green);
  border-radius: 4px;
  background: #c9f1d7;
}

.pcq-answer-map.is-wrong .pcq-map-area-key {
  border-color: var(--pcq-red);
  background: #ffd0ca;
}

.pcq-map-point-key {
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--pcq-green);
  box-shadow: 0 0 0 2px var(--pcq-green-dark);
}

.pcq-map-credit {
  margin: 11px 0 0;
  color: var(--pcq-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

.pcq-map-credit--below {
  text-align: center;
}

.pcq-map-credit a {
  color: var(--pcq-blue-dark);
  white-space: nowrap;
}

.pcq-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.pcq-next-button,
.pcq-primary-button,
.pcq-secondary-button {
  min-height: 54px;
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .15s ease, box-shadow .15s ease;
}

.pcq-next-button,
.pcq-primary-button {
  border: 0;
  background: var(--pcq-blue);
  color: #fff;
  box-shadow: 0 5px 0 var(--pcq-blue-dark);
}

.pcq-next-button {
  display: block;
  width: min(100%, 300px);
  margin: 18px auto 4px;
  padding: 12px 28px;
  font-size: 18px;
}

.pcq-next-button:hover,
.pcq-primary-button:hover,
.pcq-secondary-button:hover {
  transform: translateY(-2px);
}

.pcq-next-button:active,
.pcq-primary-button:active,
.pcq-secondary-button:active {
  transform: translateY(3px);
  box-shadow: none;
}

/* 回答後は画面サイズを問わず、地図を見たまま次へ進めるようにする。 */
.pcq-game-card.is-answered .pcq-quiz-screen {
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

.pcq-game-card.is-answered .pcq-next-button {
  position: fixed;
  z-index: 80;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  width: min(320px, calc(100vw - 24px));
  margin: 0;
  border: 2px solid rgba(255, 255, 255, .95);
  box-shadow:
    0 5px 0 var(--pcq-blue-dark),
    0 0 0 7px rgba(255, 255, 255, .92),
    0 12px 30px rgba(37, 49, 77, .24);
  transform: translateX(-50%);
}

.pcq-game-card.is-answered .pcq-next-button:hover {
  transform: translateX(-50%) translateY(-2px);
}

.pcq-game-card.is-answered .pcq-next-button:active {
  box-shadow: 0 0 0 7px rgba(255, 255, 255, .92);
  transform: translateX(-50%) translateY(3px);
}

.pcq-result-screen {
  text-align: center;
}

.pcq-result-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--pcq-yellow);
  color: #a85700;
  font-size: 38px;
  box-shadow: 0 7px 0 #e3ae20;
}

.pcq-result-screen h2 {
  display: inline-block;
  margin: 7px 0 22px;
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1.2;
}

.pcq-result-score {
  margin: 0;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 800;
  line-height: 1.6;
}

.pcq-result-score strong {
  display: block;
  color: var(--pcq-orange-dark);
  font-size: clamp(27px, 6vw, 38px);
}

.pcq-result-rate {
  margin: 16px 0 0;
  color: var(--pcq-muted);
  font-size: 18px;
  font-weight: 800;
}

.pcq-result-rate strong {
  color: var(--pcq-ink);
  font-size: 25px;
}

.pcq-result-message {
  min-height: 1.7em;
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.7;
}

.pcq-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 520px);
  margin: 30px auto 3px;
}

.pcq-primary-button,
.pcq-secondary-button {
  padding: 12px 18px;
  font-size: 16px;
}

.pcq-secondary-button {
  border: 2px solid #7b8495;
  background: #fff;
  color: var(--pcq-ink);
  box-shadow: 0 5px 0 #7b8495;
}

.pcq-data-error {
  margin: 0;
  padding: 30px 18px;
  color: #8c2626;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.8;
  text-align: center;
}

.pcq-credits {
  line-height: 1.8;
}

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

.pcq-credits h2 {
  margin: 26px 0 8px;
  font-size: clamp(19px, 3vw, 24px);
}

.pcq-credits p,
.pcq-credits li {
  color: var(--pcq-muted);
  font-size: 15px;
  font-weight: 700;
}

.pcq-credits a {
  color: var(--pcq-blue-dark);
}

.pcq-credits-back {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  margin-top: 24px;
  padding: 10px 18px;
  border: 2px solid var(--pcq-blue);
  border-radius: 14px;
  color: var(--pcq-blue-dark);
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 680px) {
  .pcq-main {
    width: calc(100% - 20px);
    min-height: calc(100svh - var(--dm-common-header-height, 50px));
    padding: 20px 0 32px;
  }

  .pcq-game-card {
    padding: 26px 18px;
    border-radius: 22px;
  }

  .pcq-quiz-screen {
    scroll-margin-top: 12px;
  }

  .pcq-mode-list {
    margin-top: 26px;
  }

  .pcq-mode-button {
    gap: 12px;
    min-height: 82px;
    padding: 12px 14px;
    border-radius: 17px;
  }

  .pcq-mode-number {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    font-size: 20px;
  }

  .pcq-answer-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pcq-question-card {
    margin-top: 20px;
    padding: 20px 12px;
    border-radius: 18px;
  }

  .pcq-answer-button {
    min-height: 58px;
  }

  .pcq-answer-map {
    margin-top: 15px;
    padding: 14px;
    border-radius: 17px;
  }

  .pcq-map-viewport {
    height: clamp(220px, 68vw, 280px);
    border-radius: 14px;
  }

  .pcq-map-legend {
    display: grid;
    gap: 8px;
  }

  .pcq-result-actions {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 25px;
  }
}

@media (max-width: 370px) {
  .pcq-game-card {
    padding-inline: 13px;
  }

  .pcq-mode-button {
    gap: 9px;
    padding-inline: 10px;
  }

  .pcq-mode-copy small {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pcq-mode-button,
  .pcq-progress-track span,
  .pcq-answer-button,
  .pcq-next-button,
  .pcq-primary-button,
  .pcq-secondary-button {
    transition: none;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .pcq-main {
    align-items: start;
    padding-block: 14px 24px;
  }

  .pcq-game-card {
    padding-block: 22px;
  }

  .pcq-question-card {
    margin-top: 16px;
    padding-block: 16px;
  }

  .pcq-answer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }

  .pcq-map-viewport {
    height: 200px;
  }
}

.pcq-play-navigation{margin-bottom:12px}.pcq-play-navigation .pcq-secondary-button{min-height:44px;padding:8px 16px;font-size:14px}.pcq-leave-dialog{width:min(440px,calc(100% - 32px));max-height:calc(100svh - 32px);padding:24px;border:2px solid var(--pcq-blue);border-radius:22px;background:#fff;color:var(--pcq-ink)}.pcq-leave-dialog::backdrop{background:#25314d80}.pcq-leave-dialog h2{margin-top:0}.pcq-leave-actions{display:grid;gap:12px}.pcq-leave-actions button{min-height:48px}
