/*
  色・線・影は 301nensai の app/globals.css と同じ値。
  宇宙の夜空に、紙の面を載せる。輪郭は太い黒、影はぼかさずずらす。
*/
:root {
  --space: #393939;
  --space2: #474645;
  --star: #ffffff;
  --star2: #c4c2bf;

  --paper: #f6f1e6;
  --paper2: #e9e2d2;
  --ink: #1a1a1a;
  --ink2: #5e5a52;

  --ufo: #c9566f;
  --dome: #a4cddb;
  --hot: #e84813;
  --car: #f2b83e;

  --beam-red: #cf4f46;
  --beam-white: #e0e0e0;
  --beam-orange: #d79527;
  --beam-blue: #3478c3;
  --beam-green: #4cb755;
  --beam-yellow: #fdd009;

  --line: 2.5px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);

  --display: "Dela Gothic One", "Hiragino Sans", sans-serif;
  --body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;

  --gutter: 16px;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--space);
  /* 表紙の星 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='260'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='18' cy='22' r='1.4'/%3E%3Ccircle cx='96' cy='9' r='1'/%3E%3Ccircle cx='170' cy='40' r='1.6'/%3E%3Ccircle cx='226' cy='14' r='1'/%3E%3Ccircle cx='52' cy='88' r='1'/%3E%3Ccircle cx='132' cy='104' r='1.3'/%3E%3Ccircle cx='205' cy='132' r='1'/%3E%3Ccircle cx='12' cy='160' r='1.2'/%3E%3Ccircle cx='84' cy='186' r='1.6'/%3E%3Ccircle cx='158' cy='206' r='1'/%3E%3Ccircle cx='230' cy='238' r='1.3'/%3E%3Ccircle cx='40' cy='246' r='1'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--star);
  font-family: var(--body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.75;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--beam-yellow);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.num {
  font-family: var(--display);
  font-weight: 400;
}

/* ---------- ヘッダー（301nensai の Logo と同じ立体文字） ---------- */
.top {
  display: flex;
  justify-content: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  padding: 0 0.14em 0.14em 0;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
}
.logo .num {
  letter-spacing: -0.02em;
  color: var(--hot);
  -webkit-text-stroke: 0.035em var(--ink);
  paint-order: stroke fill;
  text-shadow:
    0.025em 0.025em 0 #8f3613,
    0.05em 0.05em 0 #8f3613,
    0.075em 0.075em 0 #8f3613,
    0.1em 0.1em 0 #8f3613,
    0.125em 0.125em 0 var(--ink);
}
.logo .kanji {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.5em;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 0.045em var(--ink);
  paint-order: stroke fill;
  text-shadow:
    0.05em 0.05em 0 var(--ufo),
    0.1em 0.1em 0 var(--ufo),
    0.14em 0.14em 0 var(--ink);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}

/* セクション見出し。宇宙の上に白い太字 */
.sh {
  margin: 20px 0 16px;
  text-align: center;
}
.sh h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

/* ---------- 進み具合。虹色のビームが伸びる ---------- */
.steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.steps .beam {
  flex: 1;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--space2);
  overflow: hidden;
}
.steps .beam span {
  display: block;
  height: 100%;
  width: 33%;
  background: linear-gradient(
    90deg,
    var(--beam-red) 0 16.66%,
    var(--beam-white) 0 33.33%,
    var(--beam-orange) 0 50%,
    var(--beam-blue) 0 66.66%,
    var(--beam-green) 0 83.33%,
    var(--beam-yellow) 0
  );
  background-size: 300px 100%;
}
.steps p {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  color: var(--star2);
}

/* ---------- 最初の説明。オレンジの太い帯で目立たせる ---------- */
.about {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-left: 14px solid var(--hot);
  border-radius: 10px;
  box-shadow: var(--pop);
}
.about p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.85;
}
.about .ah {
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.4;
  color: var(--hot);
}
.about b {
  font-weight: 900;
}
.about ul {
  margin: 0;
  padding-left: 1.2em;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink2);
}
.about li::marker {
  color: var(--hot);
}

/* ページの見出し（Google フォームのセクション名）。宇宙の上に置く */
.ph {
  display: inline-block;
  margin: 0 0 12px;
  padding: 2px 14px;
  background: var(--car);
  color: var(--ink);
  border: var(--line);
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
}

/* ---------- 質問 ---------- */
.q {
  margin: 0 0 14px;
  padding: 16px;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  border: var(--line);
  border-radius: 10px;
}
.q legend {
  float: left; /* legend を枠の中に入れる */
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-weight: 900;
  font-size: 16px;
  line-height: 1.6;
}
.q legend + * {
  clear: both;
}
.qn {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 14px;
  color: var(--hot);
}
.must {
  display: inline-block;
  margin-left: 8px;
  padding: 0 7px;
  background: var(--hot);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  vertical-align: 2px;
}
.qs {
  margin: 0 0 12px;
  font-size: 15px;
}

/* 選択肢。押せる面を大きく。選ぶと黄色い地になる */
.opts {
  display: grid;
  gap: 8px;
}
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
}
.opt input {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
}
.opt input:checked {
  background: var(--ink);
  box-shadow: inset 0 0 0 4px #fff;
}
/* 複数選択は四角で、ラジオと見分けられるように */
.opt.box input {
  border-radius: 5px;
}
.opt.box input:checked {
  background: var(--ink)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23fdd009' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  box-shadow: none;
}
.opt:has(input:checked) {
  background: var(--car);
  box-shadow: 3px 3px 0 var(--ink);
}

/* その他：チェックの横に入力欄 */
.other {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.other input[type="text"] {
  min-width: 0;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* iPhone で入力時にズームさせない */
}
textarea {
  display: block;
  resize: vertical;
  line-height: 1.7;
}
input::placeholder,
textarea::placeholder {
  color: var(--ink2);
}

/* 5段階。数字の丸を横に並べ、両はしの言葉は下に */
.scale .dots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.scale label {
  cursor: pointer;
}
.scale input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.scale .num {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 56px;
  margin: 0 auto;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}
.scale input:checked + .num {
  background: var(--car);
  box-shadow: 3px 3px 0 var(--ink);
}
.scale input:focus-visible + .num {
  outline: 3px solid var(--beam-blue);
  outline-offset: 2px;
}
.scale .ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink2);
}

.err {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #c2200e;
}
.q.bad {
  border-color: #c2200e;
  box-shadow: 4px 4px 0 #c2200e;
}
.sendErr {
  padding: 10px 14px;
  background: var(--paper);
  border: var(--line);
  border-radius: 8px;
}

/* ---------- 戻る・次へ ---------- */
.nav {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  margin-top: 20px;
}
.nav .primary:only-child,
.nav .sub[hidden] + .primary {
  grid-column: 1 / -1;
}
.primary,
.sub {
  min-height: 52px;
  border: var(--line);
  border-radius: 999px;
  font-size: 17px;
  font-weight: 900;
}
.primary {
  background: var(--beam-yellow);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.primary:disabled {
  opacity: 0.6;
  cursor: default;
}
.sub {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 送信後 ---------- */
.done {
  padding: 22px 18px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--pop);
  text-align: center;
}
.done p {
  margin: 0 0 12px;
  line-height: 1.85;
}
.done .dh {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.4;
  color: var(--hot);
}
.done a {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 22px;
  background: var(--beam-yellow);
  color: var(--ink);
  border: var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.foot {
  padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 12px;
  color: var(--star2);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 960px) {
  .logo {
    font-size: 44px;
  }
  .sh h1 {
    font-size: 30px;
  }
  .sh h1 br {
    display: none;
  }
}
