/* Bitalk Mirror sender — light, kids-friendly, works on Chromebook & iPad */
:root {
  --brand: #1f4e79;
  --brand-2: #2e74b5;
  --accent: #f5a623;
  --bg: #f7fafc;
  --card: #ffffff;
  --text: #1a202c;
  --muted: #64748b;
  --warn: #c00000;
  --ok: #2f855a;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  --pad: clamp(12px, 3vw, 20px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic",
               "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
header {
  padding: var(--pad);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
header h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
header .subtitle { margin: 6px 0 0; opacity: 0.9; font-size: 0.95rem; }
main {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step {
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}
.step.visible { display: block; }
.step h2 { margin-top: 0; color: var(--brand); font-size: 1.15rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

input[type="tel"], input[type="text"] {
  flex: 1 1 200px;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
input[type="tel"]:focus { outline: none; border-color: var(--brand-2); }

button {
  min-height: 48px;
  padding: 10px 22px;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  background: var(--brand-2);
  color: #fff;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
}
button:hover { background: var(--brand); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); font-weight: 600; padding: 14px 28px; font-size: 1.1rem; }
button.warn { background: var(--warn); }

/* 表示名の入力欄。6 桁コード入力と同じ input[type=text] 指定に
   引きずられないよう、字間・寄せ・文字サイズを打ち消す。 */
.name-row { margin-top: 14px; }
.name-row label { color: var(--muted); font-size: 0.9rem; flex: 0 0 auto; }
.name-row input[type="text"] {
  flex: 1 1 140px;
  font-size: 1rem;
  letter-spacing: normal;
  text-align: left;
  padding: 10px 14px;
}

.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.error { color: var(--warn); margin-top: 8px; min-height: 1.2em; }
.status { color: var(--ok); margin-top: 12px; min-height: 1.2em; }

.qr-scan-wrap { margin-top: 18px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.qr-scan-wrap summary { cursor: pointer; color: var(--brand-2); font-weight: 600; }
#qr-video {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #000;
  margin: 12px 0;
}

#preview {
  width: 100%;
  max-height: 40vh;
  background: #000;
  border-radius: 10px;
  margin: 10px 0;
}

footer {
  padding: 20px var(--pad);
  color: var(--muted);
  text-align: center;
  font-size: 0.8rem;
}
