/* 色は4つだけ。背景は白／黒に寄せ、強調色は置かない。
   角丸・影・枠線の装飾は使わない。線は入力欄の下の1本だけ */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #dcdcdc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d;
    --fg: #f2f2f2;
    --muted: #767676;
    --line: #2c2c2c;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  /* フォントは fonts.css で自前配信している（外部CDNを使わない）。
     部分集合に無い文字（cp932外の漢字・ハングル等）だけがこの先へ落ちる */
  font-family: "Noto Sans JP Subset", -apple-system, BlinkMacSystemFont,
               "Hiragino Sans", "Yu Gothic Medium", sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--fg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

main {
  width: 100%;
  max-width: 30rem;
}

h1 {
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 20px;
}

#q {
  width: 100%;
  /* 16px未満だと iOS Safari が自動でズームする */
  font-size: 1.35rem;
  font-family: inherit;
  color: var(--fg);
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 0;
  -webkit-appearance: none;
}

#q::placeholder { color: var(--muted); }

#q:focus {
  outline: none;
  border-bottom-color: var(--fg);
}

#hint {
  margin-top: 8px;
  font-size: .75rem;
  color: var(--muted);
}

/* 結果は入力欄のすぐ下に、答えの一行だけを置く。
   枠も色分けもしない。文言そのものが答えなので装飾は要らない */
#result:empty { display: none; }

#result {
  margin-top: 36px;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.6;
}

#result .note {
  display: block;
  margin-top: 6px;
  font-size: .8rem;
  font-weight: 400;
  color: var(--muted);
}

#result.absent { color: var(--muted); }

/* 「このサイトについて」は隅に小さく置く */
#about-open {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  margin: 0 auto;
  font-family: inherit;
  font-size: .72rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

dialog {
  max-width: 30rem;
  margin: auto;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 24px;
  font-size: .82rem;
  line-height: 1.8;
}

dialog::backdrop { background: rgba(0, 0, 0, .4); }

dialog p + p { margin-top: 12px; }

#about-meta { color: var(--muted); }

#about-close {
  margin-top: 20px;
  font-family: inherit;
  font-size: .8rem;
  color: var(--fg);
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  padding: 2px 0;
}
