:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #667085;
  --accent: #3178c6;
  --accent-text: #ffffff;
  --border: #dde3ee;
  --error: #c0362c;
  --ok: #1f7a46;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151d;
    --card: #1a202b;
    --text: #e6e9ef;
    --muted: #98a2b3;
    --accent: #5a9be0;
    --accent-text: #0b1220;
    --border: #2b3342;
    --error: #ff7b72;
    --ok: #56d364;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.6;
}
header, main, footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 32px; }
h1 { margin: 0; font-size: 2.2rem; letter-spacing: -0.02em; }
h1 span { color: var(--accent); }
h2 { margin-top: 0; font-size: 1.15rem; }
.tagline { color: var(--muted); margin-top: 4px; }
code { background: var(--border); padding: 1px 6px; border-radius: 4px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.muted { color: var(--muted); font-size: 0.9rem; }
.big { font-size: 1.4rem; font-weight: 700; word-break: break-all; }
.status { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.status button { margin-left: auto; }
label { display: block; margin-bottom: 12px; font-size: 0.9rem; }
input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1 1 160px; width: auto; margin-top: 0; }
button {
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.95rem;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.items, .inventory { list-style: none; padding: 0; margin: 0; }
.items li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.items li:first-child { border-top: none; }
.items .info { flex: 1; }
.items .price { font-weight: 700; white-space: nowrap; }
.inventory li { padding: 4px 0; }
.secret {
  display: block;
  margin-top: 4px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
  font-family: ui-monospace, monospace;
  word-break: break-all;
}
.cleared { border: 2px solid var(--ok); }
.submit-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
  border: 2px dashed var(--accent);
}
.submit-link:hover { border-style: solid; }
h1 a.home { color: inherit; text-decoration: none; }

/* スマホ (タッチ操作の端末) でだけ表示する */
.mobile-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .mobile-only { display: block; }
}
a.button {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-size: 0.95rem;
}
a.button.secondary { background: transparent; color: var(--accent); }
select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px; /* 16px 未満だと iPhone が入力時に拡大してしまう */
}
textarea { font-family: ui-monospace, monospace; resize: vertical; }
.row select { width: auto; margin-top: 0; }
.tabs { margin-bottom: 12px; }
.tabs button { font-size: 0.85rem; padding: 6px 10px; }
pre.code {
  margin: 0;
  padding: 12px 12px 12px 0;
  border-radius: 8px;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  counter-reset: line;
  -webkit-text-size-adjust: 100%;
}
/* highlight.js のテーマの背景色ではなく、サイトの配色に合わせる */
pre.code.hljs { background: var(--bg); color: var(--text); }
/* 行番号 */
pre.code .line { display: block; padding-left: 3.6em; text-indent: -3.6em; }
pre.code .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 2.6em;
  margin-right: 1em;
  text-align: right;
  text-indent: 0;
  color: var(--muted);
  opacity: 0.7;
  user-select: none;
  -webkit-user-select: none;
}
pre.code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.tagline a { color: var(--accent); }
@media (max-width: 700px) {
  pre.code { font-size: 0.8rem; }
}
.wrap-toggle { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.wrap-toggle input { width: auto; margin: 0; }
.share {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
@media (prefers-color-scheme: dark) {
  .share { background: #fff; color: #000; }
}
#message { min-height: 1.6em; font-weight: 600; }
#message.error { color: var(--error); }
#message.ok { color: var(--ok); }
footer { padding: 24px 16px 40px; font-size: 0.9rem; }
footer a { color: var(--accent); }
