/* TURING TEST — 白黒＋コンピュータ／暗号風 */

:root {
  --bg: #000;
  --fg: #e8e8e8;
  --dim: #8a8a8a;
  --line: #2e2e2e;
  --accent: #fff;
  --mono: "SFMono-Regular", Consolas, "Courier New", "BIZ UDGothic",
          "Yu Gothic", "Hiragino Kaku Gothic ProN", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

/* 走査線エフェクト */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.030) 0px,
    rgba(255,255,255,.030) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  position: relative;
  z-index: 1;
}

/* ---------- ヒーロー ---------- */
.hero { text-align: center; margin-bottom: 40px; }

.prompt {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: .08em;
  margin: 0 0 18px;
}
.caret { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.logo {
  margin: 0;
  font-size: clamp(30px, 8.5vw, 58px);
  letter-spacing: .16em;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(255,255,255,.28);
}

.tagline {
  margin: 12px 0 0;
  color: var(--dim);
  letter-spacing: .12em;
  font-size: 14px;
}

/* ---------- パネル ---------- */
.panel {
  border: 1px solid var(--line);
  background: #050505;
  padding: 18px;
  margin-bottom: 22px;
}

.panel-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--dim);
  text-transform: uppercase;
}
.counter { letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.counter.over { color: #fff; text-decoration: underline; }

/* ---------- 入力 ---------- */
textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  background: #000;
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 14px;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.9;
  outline: none;
}
textarea:focus { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg) inset; }
textarea::placeholder { color: #4a4a4a; }

.hint { color: var(--dim); font-size: 12px; margin: 10px 2px 16px; min-height: 1.2em; }
.hint.error { color: #fff; }

/* ---------- ボタン ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  background: #000;
  color: var(--fg);
  border: 1px solid var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.btn:hover, .btn:focus-visible { background: var(--fg); color: #000; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:hover { background: #000; color: var(--fg); }

.btn-sm { width: auto; flex: 1 1 auto; font-size: 13px; padding: 11px 14px; }
.btn-ghost { border-color: var(--line); color: var(--dim); }

/* ---------- 結果 ---------- */
.result { animation: fade .3s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.score-label { margin: 6px 0 10px; letter-spacing: .3em; font-size: 12px; color: var(--dim); }

.ascii-bar {
  font-size: clamp(13px, 3.6vw, 20px);
  letter-spacing: .06em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 6px;
}

.score {
  margin: 4px 0 12px;
  font-size: clamp(52px, 16vw, 92px);
  line-height: 1;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 22px rgba(255,255,255,.3);
}
.score .pct { font-size: .38em; margin-left: .12em; color: var(--dim); }

.meter { height: 6px; background: #161616; border: 1px solid var(--line); }
.meter-fill { height: 100%; width: 0; background: var(--fg); transition: width .7s cubic-bezier(.2,.8,.2,1); }

.verdict { margin: 18px 0 4px; font-size: 20px; letter-spacing: .06em; }
.verdict-sub { margin: 0; color: var(--dim); font-size: 14px; }

.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li { padding: 7px 0 7px 1.6em; position: relative; font-size: 14.5px; border-bottom: 1px dashed #1a1a1a; }
.reasons li:last-child { border-bottom: none; }
.reasons li::before { content: "・"; position: absolute; left: .2em; color: var(--dim); }
.reasons li .tag { color: var(--dim); font-size: 11px; letter-spacing: .1em; margin-right: .6em; }

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

.card-preview {
  width: 100%;
  height: auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  display: block;
}

/* ---------- 注意書き ---------- */
.notice {
  border: 1px solid var(--line);
  padding: 18px;
  margin-top: 34px;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.9;
}
.notice p { margin: 0 0 6px; }
.notice .warn { color: var(--fg); margin-top: 12px; }

.foot { margin-top: 34px; text-align: center; font-size: 11.5px; color: var(--dim); letter-spacing: .06em; }
.foot p { margin: 4px 0; }
.muted { color: #565656; }

@media (max-width: 480px) {
  .wrap { padding: 32px 14px 60px; }
  .panel { padding: 14px; }
  .btn-sm { flex: 1 1 100%; }
}

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