
.page {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.tool-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.block { display: flex; flex-direction: column; gap: 8px; }
.block-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 140ms, background 140ms;
  line-height: 1.7;
}
textarea:focus { border-color: #6b7280; background: var(--surface); }
textarea::placeholder { color: #d1d5db; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--sub);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms, border-color 100ms, color 100ms;
  user-select: none;
}
.chip:hover { background: var(--hover); border-color: #9ca3af; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 600;
}
.chip-preview { font-size: 15px; font-weight: 700; line-height: 1; }

.color-row { display: flex; flex-wrap: wrap; gap: 20px; }
.color-group { display: flex; flex-direction: column; gap: 8px; }
.color-group-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase;
}
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 120ms, border-color 120ms;
  flex-shrink: 0;
  outline: none;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--ink); transform: scale(1.1); }
.swatch-custom { position: relative; width: 28px; height: 28px; }
.swatch-custom input[type="color"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: none; padding: 0;
}
.swatch-custom .swatch-face {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 2px dashed var(--border);
  display: grid; place-items: center;
  color: var(--muted);
  pointer-events: none;
  font-size: 14px; line-height: 1;
  background: var(--surface);
}

.preview-wrap {
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
  height: 260px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background 200ms;
}
.preview-text {
  padding: 5%; text-align: center;
  font-weight: 900; line-height: 1.2;
  word-break: break-word; white-space: pre-wrap;
  width: 100%;
  transition: color 200ms, font-family 200ms;
  letter-spacing: 0.02em;
}
.preview-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; pointer-events: none;
}

.show-btn {
  appearance: none; width: 100%; border: none;
  background: var(--accent); color: white;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: 0.04em;
  padding: 14px 20px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 140ms, transform 100ms;
}
.show-btn:hover:not(:disabled) { background: var(--accent-deep); transform: translateY(-1px); }
.show-btn:active:not(:disabled) { transform: translateY(0); }
.show-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

#boardOverlay {
  display: none; position: fixed; inset: 0;
  z-index: 9999; align-items: center; justify-content: center;
  transition: background 200ms;
}
#boardOverlay.visible { display: flex; }
#overlayText {
  padding: 5%; text-align: center;
  font-weight: 900; line-height: 1.2;
  word-break: break-word; white-space: pre-wrap;
  width: 100%; letter-spacing: 0.02em;
}
#overlayClose {
  position: fixed; top: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.25); color: #fff;
  border: none; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; transition: opacity 200ms, background 140ms; z-index: 10000;
}
#boardOverlay.visible:hover #overlayClose,
#boardOverlay.visible #overlayClose:focus { opacity: 1; }
#overlayClose:hover { background: rgba(0,0,0,0.45); }


@media (max-width: 900px) {
  .preview-wrap { height: 200px; }
}
